diff options
author | Marek Rusinowski <marekrusinowski@gmail.com> | 2016-05-04 15:36:35 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-05-11 16:37:12 +0200 |
commit | a6bbbe60874cd7f92bcf55f75fa26f33957e9b25 (patch) | |
tree | 90d2fc66ebffd4da79918750f17ede155e219cde /cmds-subvolume.c | |
parent | 5c5a6227721a779389af3e7eb67b63f15c638eb9 (diff) |
btrfs-progs: subvolume sync: fix handling of -s option
Setting check interval for subvolume sync resulted
in picking wrong element from argv for it's value:
$ btrfs subvolume sync -s 10 ./dir
ERROR: invalid sleep interval ./dir
$ btrfs subvolume sync ./dir -s 10
Segmentation fault
Signed-off-by: Marek Rusinowski <marekrusinowski@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-subvolume.c')
-rw-r--r-- | cmds-subvolume.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 7c8ab8f2..e3d2cbce 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -1195,10 +1195,9 @@ static int cmd_subvol_sync(int argc, char **argv) switch (c) { case 's': - sleep_interval = atoi(argv[optind]); + sleep_interval = atoi(optarg); if (sleep_interval < 1) { - error("invalid sleep interval %s", - argv[optind]); + error("invalid sleep interval %s", optarg); ret = 1; goto out; } |