From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 19 Oct 2015 06:16:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,701,1437462000"; d="scan'208";a="830312710" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.208.63]) by fmsmga002.fm.intel.com with SMTP; 19 Oct 2015 06:16:18 -0700 Received: by (sSMTP sendmail emulation); Mon, 19 Oct 2015 14:16:17 +0025 Date: Mon, 19 Oct 2015 14:16:17 +0100 From: Bruce Richardson To: Tiwei Bie 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 Content-Disposition: inline In-Reply-To: <1445260390-78613-1-git-send-email-btw@mail.ustc.edu.cn> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org, dprovan@bivio.net Subject: Re: [dpdk-dev] [PATCH v2] eal: don't reset getopt lib X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2015 13:16:21 -0000 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