badblocks: fix a bug in the read throttling

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>
bitmap-optimize
Iustin Pop 2008-06-18 22:26:26 +02:00 committed by Theodore Ts'o
parent 401ab44b01
commit edf261f6f8
1 changed files with 3 additions and 2 deletions

View 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)