From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH v2] eal: don't reset getopt lib Date: Mon, 19 Oct 2015 14:16:17 +0100 Message-ID: <20151019131617.GB13556@bricha3-MOBL3> References: <1444909564-53691-1-git-send-email-btw@mail.ustc.edu.cn> <1445260390-78613-1-git-send-email-btw@mail.ustc.edu.cn> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, dprovan@bivio.net To: Tiwei Bie Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id AA7435961 for ; Mon, 19 Oct 2015 15:16:20 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1445260390-78613-1-git-send-email-btw@mail.ustc.edu.cn> 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 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