mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-22 22:23:32 +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) {
|
switch (c) {
|
||||||
case 's':
|
case 's':
|
||||||
sleep_interval = atoi(argv[optind]);
|
sleep_interval = atoi(optarg);
|
||||||
if (sleep_interval < 1) {
|
if (sleep_interval < 1) {
|
||||||
error("invalid sleep interval %s",
|
error("invalid sleep interval %s", optarg);
|
||||||
argv[optind]);
|
|
||||||
ret = 1;
|
ret = 1;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user