From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] eal: don't reset getopt lib Date: Wed, 04 Nov 2015 23:21:03 +0100 Message-ID: <7181004.z2BJ7V5WGs@xps13> References: <1444909564-53691-1-git-send-email-btw@mail.ustc.edu.cn> <20151019131617.GB13556@bricha3-MOBL3> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, dprovan@bivio.net To: Tiwei Bie Return-path: Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by dpdk.org (Postfix) with ESMTP id AF36F8F9B for ; Wed, 4 Nov 2015 23:22:46 +0100 (CET) Received: by wicll6 with SMTP id ll6so99197239wic.0 for ; Wed, 04 Nov 2015 14:22:46 -0800 (PST) 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" > > > 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 Applied, thanks