[dpdk-dev] [PATCH v2] eal: don't reset getopt lib

Tiwei Bie btw at mail.ustc.edu.cn
Wed Oct 21 08:17:18 CEST 2015


On Wed, Oct 21, 2015 at 07:33:42AM +0200, David Marchand wrote:
> On Mon, Oct 19, 2015 at 3:16 PM, Bruce Richardson <bruce.richardson at intel.com>
> 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 <dprovan at bivio.net>
> > > Suggested-by: Bruce Richardson <bruce.richardson at intel.com>
> > > Signed-off-by: Tiwei Bie <btw at mail.ustc.edu.cn>
> > > Reviewed-by: Don Provan <dprovan at bivio.net>
> > > Reviewed-by: Bruce Richardson <bruce.richardson at intel.com>
> > 
> > Acked-by: Bruce Richardson <bruce.richardson at intel.com>
> > 
> 
> Acked-by: David Marchand <david.marchand at 6wind.com>
> 
> Thanks Tiwei.
> 

My pleasure. Thanks! :-)

Best regards,
Tiwei Bie



More information about the dev mailing list