Whamcloud - gitweb
badblocks: fix a bug in the read throttling
authorIustin Pop <iustin@google.com>
Wed, 18 Jun 2008 20:26:26 +0000 (22:26 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 21 Jun 2008 18:43:25 +0000 (14:43 -0400)
The previous patch was missing an #include and thus the compiler didn't
catch the (now obvious) error.

Signed-off-by: Iustin Pop <iustin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/badblocks.c

index 6bd95bd..15fe5af 100644 (file)
@@ -48,6 +48,7 @@ extern int optind;
 #include <time.h>
 #include <limits.h>
 
+#include <sys/time.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
 
@@ -285,10 +286,10 @@ static int do_read (int dev, unsigned char * buffer, int try, int block_size,
 
        /* Try the read */
        if (d_flag)
-               gettimeofday(&tv1);
+               gettimeofday(&tv1, NULL);
        got = read (dev, buffer, try * block_size);
        if (d_flag)
-               gettimeofday(&tv2);
+               gettimeofday(&tv2, NULL);
        if (got < 0)
                got = 0;        
        if (got & 511)