mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-22 14:13:04 +00:00
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>
This commit is contained in:
parent
5c5a622772
commit
a6bbbe6087
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user