btrfs-progs: Adjust timing of safety delay countdown

When printing the countdown in the safety delay, the number should
correspond to the number of seconds remaining to wait at the time the
delay is printed.

In other words, there should be a one second sleep after printing '1'.

Signed-off-by: Noah Massey <noah.massey@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
master
Noah Massey 2016-05-04 15:43:26 -04:00 committed by David Sterba
parent a6bbbe6087
commit 00fd553853
1 changed files with 1 additions and 1 deletions

View File

@ -445,9 +445,9 @@ static int do_balance(const char *path, struct btrfs_ioctl_balance_args *args,
printf("\twarning. The operation will start in %d seconds.\n", delay);
printf("\tUse Ctrl-C to stop it.\n");
while (delay) {
sleep(1);
printf("%2d", delay--);
fflush(stdout);
sleep(1);
}
printf("\nStarting balance without any filters.\n");
}