X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=time.c;h=4af84bc7cc5b6a2e1f0be57f284e3e6c3d57f2c8;hp=ef05094e733915fc1c2c59a0ef8bd17ac8d9613b;hb=7386d4aec9d105ba1409a7491b4b63aec3c7105b;hpb=d9a7ba88af39b1047c9f8c077280932cd12cb58e diff --git a/time.c b/time.c index ef05094e..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; }