]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
badblocks: Fix progress output for "badblocks -sw /dev/XXX"
authorTheodore Ts'o <tytso@mit.edu>
Thu, 2 Oct 2008 00:00:54 +0000 (20:00 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 2 Oct 2008 00:00:54 +0000 (20:00 -0400)
Always initialize the starting time so that badblocks -sw works.
Thanks Jelle de Jong (jelledejong at powercraft.nl) for reporting this
bug.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
misc/badblocks.c

index e7e99684d586d4abc70d84a4ebcee662f09565b6..f7d67a77a343e16263e8aa2a632be155a66b4322 100644 (file)
@@ -1030,7 +1030,6 @@ int main (int argc, char ** argv)
                        break;
                case 'v':
                        v_flag++;
-                       gettimeofday(&time_start, 0);
                        break;
                case 'w':
                        if (w_flag)
@@ -1142,6 +1141,7 @@ int main (int argc, char ** argv)
        if (w_flag)
                check_mount(device_name);
 
+       gettimeofday(&time_start, 0);
        open_flag = O_LARGEFILE | (w_flag ? O_RDWR : O_RDONLY);
        dev = open (device_name, open_flag);
        if (dev == -1) {