X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=time.c;h=4af84bc7cc5b6a2e1f0be57f284e3e6c3d57f2c8;hb=a5e371a61c9e37a2389f7473d65e35b29dec1ccd;hp=7015fd51b4bccf69dbf6d7c34b45569eda87a67f;hpb=09a324028d68c485a8c4b33257b262123c27394f;p=fio.git diff --git a/time.c b/time.c index 7015fd51..4af84bc7 100644 --- a/time.c +++ b/time.c @@ -48,16 +48,13 @@ unsigned long mtime_since(struct timeval *s, struct timeval *e) usec += 1000000; } + if (sec < 0 || (sec == 0 && usec < 0)) + return 0; + sec *= 1000UL; usec /= 1000UL; ret = sec + usec; - /* - * time warp bug on some kernels? - */ - if (ret < 0) - ret = 0; - return ret; } @@ -150,7 +147,7 @@ int ramp_time_over(struct thread_data *td) return 0; } -void fio_init fio_time_init(void) +void fio_time_init(void) { int i;