[sheepdog] [PATCH] collie: correct command-line options parser
輕微
cz at de3eb.cn
Mon Mar 18 07:28:42 CET 2013
Ok!It's my pleasure :-)
Thanks,
Zhe
------------------ Original ------------------
From: "Liu Yuan"<namei.unix at gmail.com>;
Date: Mon, Mar 18, 2013 01:12 PM
To: "ChenZhe"<cz at de3eb.cn>;
Cc: "MORITA Kazutaka"<morita.kazutaka at gmail.com>; "ChenZhe"<chenzhe at xinnet.com>; "sheepdog"<sheepdog at lists.wpkg.org>;
Subject: Re: [sheepdog] [PATCH] collie: correct command-line options parser
On 03/18/2013 01:08 PM, Liu Yuan wrote:
> On 03/18/2013 08:43 AM, MORITA Kazutaka wrote:
>>>>>> + if (flags & SUBCMD_FLAG_NEED_THIRD_ARG && optind <= 3)
>>>>>> subcommand_usage(argv[1], argv[2], EXIT_USAGE);
>>>>>>
>>>>>> return command_fn(argc, argv);
>>>>>>
>>>>
>>>> Kazutaka, this bug does exist (even with '-p 7001'), but 'optind <= 3'
>>>> looks quite suspicious to me, could you review it?
>> It is not a good idea to increase optind before getopt_long. The real
>> problem is that we specify the thrid arguemnt as argv[3] in
>> cluster_recover. It should be argv[optind].
>
> ChenZhe, could you prepare a new patch v2 based on this comment?
>
Hi ChenZhe,
There are other places use the wrong argv[3] too, such as
vdi_cache() and debug_trace(). You'd better correct them too in V2.
Thanks,
Yuan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/sheepdog/attachments/20130318/accb39c2/attachment-0004.html>
More information about the sheepdog
mailing list