From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tiwei Bie Subject: Re: [PATCH v2] eal: don't reset getopt lib Date: Wed, 21 Oct 2015 14:17:18 +0800 Message-ID: <20151021061718.GA68563@dell> References: <1444909564-53691-1-git-send-email-btw@mail.ustc.edu.cn> <1445260390-78613-1-git-send-email-btw@mail.ustc.edu.cn> <20151019131617.GB13556@bricha3-MOBL3> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: "dev@dpdk.org" , dprovan@bivio.net To: David Marchand Return-path: Received: from ustc.edu.cn (smtp2.ustc.edu.cn [202.38.64.46]) by dpdk.org (Postfix) with ESMTP id 9693D91DC for ; Wed, 21 Oct 2015 08:17:22 +0200 (CEST) Content-Disposition: inline In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Oct 21, 2015 at 07:33:42AM +0200, David Marchand wrote: > On Mon, Oct 19, 2015 at 3:16 PM, Bruce Richardson > wrote: > > > On Mon, Oct 19, 2015 at 09:13:10PM +0800, Tiwei Bie wrote: > > > Someone may need to call rte_eal_init() with a fake argc/argv array > > > in the middle of using getopt() to parse its own unrelated argc/argv > > > parameters. So getopt lib shouldn't be reset by rte_eal_init(). > > > > > > Now eal will always save optind, optarg and optopt (and optreset on > > > FreeBSD) at the beginning, initialize optind (and optreset on FreeBSD) > > > to 1 before calling getopt_long(), then restore all values after. > > > > > > Suggested-by: Don Provan > > > Suggested-by: Bruce Richardson > > > Signed-off-by: Tiwei Bie > > > Reviewed-by: Don Provan > > > Reviewed-by: Bruce Richardson > > > > Acked-by: Bruce Richardson > > > > Acked-by: David Marchand > > Thanks Tiwei. > My pleasure. Thanks! :-) Best regards, Tiwei Bie