From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tiwei Bie Subject: Re: [PATCH] eal: don't reset getopt lib Date: Mon, 19 Oct 2015 21:15:08 +0800 Message-ID: <20151019131508.GA3867@dell> References: <1444909564-53691-1-git-send-email-btw@mail.ustc.edu.cn> <20151019103641.GA13936@bricha3-MOBL3> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: dev@dpdk.org, dprovan@bivio.net To: Bruce Richardson Return-path: Received: from ustc.edu.cn (smtp2.ustc.edu.cn [202.38.64.46]) by dpdk.org (Postfix) with ESMTP id 9B6C75961 for ; Mon, 19 Oct 2015 15:15:14 +0200 (CEST) Content-Disposition: inline In-Reply-To: <20151019103641.GA13936@bricha3-MOBL3> 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 11:36:41AM +0100, Bruce Richardson wrote: > On Thu, Oct 15, 2015 at 07:46:04PM +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. > > This patch looks good overall. Minor comment inline below. > Thanks for review! :-) Best regards, Tiwei Bie