[dpdk-dev] [PATCH v2] eal: don't reset getopt lib
Bruce Richardson
bruce.richardson at intel.com
Mon Oct 19 15:16:17 CEST 2015
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>
More information about the dev
mailing list