projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
solaris: fix compile error on ctime_r()
[fio.git]
/
time.c
diff --git
a/time.c
b/time.c
index 6397f20e01dc8e2ce0cb0067311c155e9c7dce82..4af84bc7cc5b6a2e1f0be57f284e3e6c3d57f2c8 100644
(file)
--- a/
time.c
+++ b/
time.c
@@
-48,16
+48,13
@@
unsigned long mtime_since(struct timeval *s, struct timeval *e)
usec += 1000000;
}
usec += 1000000;
}
+ if (sec < 0 || (sec == 0 && usec < 0))
+ return 0;
+
sec *= 1000UL;
usec /= 1000UL;
ret = sec + usec;
sec *= 1000UL;
usec /= 1000UL;
ret = sec + usec;
- /*
- * time warp bug on some kernels?
- */
- if (ret < 0)
- ret = 0;
-
return ret;
}
return ret;
}
@@
-150,10
+147,12
@@
int ramp_time_over(struct thread_data *td)
return 0;
}
return 0;
}
-
static void fio_init
time_init(void)
+
void fio_
time_init(void)
{
int i;
{
int i;
+ fio_clock_init();
+
/*
* Check the granularity of the nanosleep function
*/
/*
* Check the granularity of the nanosleep function
*/