Re: [PATCH] Fix broken 'device scan' arguments parsing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 09, 2016 at 05:24:16PM +0900, Satoru Takeuchi wrote:
> > --- a/cmds-device.c
> > +++ b/cmds-device.c
> > @@ -273,7 +273,7 @@ static int cmd_device_scan(int argc, char **argv)
> >   	if (all && check_argc_max(argc - optind, 1))
> 
> It's better to the above line as follows.
> 
> ========
> 	if (all && check_argc_exact(argc - optind, 0))

check_argc_exact prints error messages, and is usually followed by
the usage() call that exits. In the condition it's supposed to check if
there are no arguments (ie. scan all) or if the -d option was given
(scan all). The validity of the option combinations should be done
before that, so the patch is IMO correct.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux