All of lore.kernel.org
 help / color / mirror / Atom feed
From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH nvme-cli] argconfig: Rewind optind before looping on getopt_long
Date: Thu, 13 Oct 2016 12:10:06 -0400	[thread overview]
Message-ID: <20161013161005.GD17823@localhost.localdomain> (raw)
In-Reply-To: <1476373205-30860-1-git-send-email-sagi@grimberg.me>

On Thu, Oct 13, 2016@06:40:05PM +0300, Sagi Grimberg wrote:
> In conf file based discovery we can call argconfig_parse
> multiple times.

Jay beat you to it. :)

  https://github.com/linux-nvme/nvme-cli/commit/2da2440f1e5e98df61b192446be7c68a170dcda6

> Reported-by: Jay Freyensee <james_p_freyensee at linux.intel.com>
> Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
> ---
>  argconfig.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/argconfig.c b/argconfig.c
> index e2bb7ab26446..bda8b03c1cbd 100644
> --- a/argconfig.c
> +++ b/argconfig.c
> @@ -193,6 +193,7 @@ int argconfig_parse(int argc, char *argv[], const char *program_desc,
>  	short_opts[short_index++] = 'h';
>  	short_opts[short_index] = 0;
>  
> +	optind = 0;
>  	while ((c = getopt_long_only(argc, argv, short_opts, long_opts,
>  				&option_index)) != -1) {
>  		if (c != 0) {

  reply	other threads:[~2016-10-13 16:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-13 15:40 [PATCH nvme-cli] argconfig: Rewind optind before looping on getopt_long Sagi Grimberg
2016-10-13 16:10 ` Keith Busch [this message]
2016-10-13 16:00   ` Sagi Grimberg
2016-10-13 16:40     ` J Freyensee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161013161005.GD17823@localhost.localdomain \
    --to=keith.busch@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.