summaryrefslogtreecommitdiff
path: root/cmds-device.c
diff options
context:
space:
mode:
authorSatoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>2016-03-11 09:26:13 +0900
committerDavid Sterba <dsterba@suse.com>2016-03-14 13:42:47 +0100
commit1ff2823225a677c114f78c61a3e79573e52a26b0 (patch)
treecda6b1c42cafcf4cbedb60e5696454e283437223 /cmds-device.c
parent3ee935e4dd23a97de31a07e36b32871730801e05 (diff)
btrfs-progs: Fix device scan to interpret its argument properly
Fix the following bug. ================================ # btrfs device scan -- /dev/sdb ERROR: not a block device: -- ================================ It should work as follow. ================================ # ./btrfs device scan -- /dev/sdb Scanning for Btrfs filesystems in '/dev/sdb' ================================ Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-device.c')
-rw-r--r--cmds-device.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmds-device.c b/cmds-device.c
index a8f10f6d..9906d4a3 100644
--- a/cmds-device.c
+++ b/cmds-device.c
@@ -222,7 +222,7 @@ static const char * const cmd_device_scan_usage[] = {
static int cmd_device_scan(int argc, char **argv)
{
int i;
- int devstart = 1;
+ int devstart;
int all = 0;
int ret = 0;
@@ -245,6 +245,7 @@ static int cmd_device_scan(int argc, char **argv)
usage(cmd_device_scan_usage);
}
}
+ devstart = optind;
if (all && check_argc_max(argc - optind, 1))
usage(cmd_device_scan_usage);