mirror of https://github.com/vitalif/e2fsprogs
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
parent
401ab44b01
commit
edf261f6f8
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue