From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH] eal/bsd: reinitialize optind and optreset to 1 Date: Tue, 13 Oct 2015 15:58:52 +0100 Message-ID: <20151013145852.GA34332@bricha3-MOBL3> References: <1444726446-8106-1-git-send-email-btw@mail.ustc.edu.cn> <1444726446-8106-2-git-send-email-btw@mail.ustc.edu.cn> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Tiwei Bie Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id D31275A63 for ; Tue, 13 Oct 2015 16:58:56 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1444726446-8106-2-git-send-email-btw@mail.ustc.edu.cn> 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 Tue, Oct 13, 2015 at 04:54:06PM +0800, Tiwei Bie wrote: > The variable optind must be reinitialized to 1 in order to skip over > argv[0] on FreeBSD. Because getopt() on FreeBSD will return -1 when > it meets an argument which doesn't start with '-'. > > The variable optreset is provided on FreeBSD to indicate the additional > set of calls to getopt(). So, also reinitialize it to 1. > > Signed-off-by: Tiwei Bie Acked-by: Bruce Richardson