[dpdk-dev] [PATCH] eal: don't reset getopt lib
Tiwei Bie
btw at mail.ustc.edu.cn
Mon Oct 19 15:15:08 CEST 2015
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
More information about the dev
mailing list