From 7e326f3bbc7e6f23f2b4c99282f73a7948d02637 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Sat, 13 Jan 2007 15:17:22 +0100 Subject: [PATCH] [PATCH] Remove the time init check We cannot control constructor ordering easily, hence the check code was also in fio_gettime(). Signed-off-by: Jens Axboe --- gettime.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/gettime.c b/gettime.c index 161240ee..533ec97b 100644 --- a/gettime.c +++ b/gettime.c @@ -113,26 +113,18 @@ void fio_gettime(struct timeval *tp, void fio_unused *caller) gtod_log_caller(caller); #endif -repeat: - if (!clock_gettime_works) + if (!clock_gettime_works) { +gtod: gettimeofday(tp, NULL); - else { + } else { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0) { clock_gettime_works = 0; - goto repeat; + goto gtod; } tp->tv_sec = ts.tv_sec; tp->tv_usec = ts.tv_nsec / 1000; } } - -static void fio_init check_clock(void) -{ - struct timespec ts; - - if (clock_getres(CLOCK_MONOTONIC, &ts) < 0) - clock_gettime_works = 0; -} -- 2.25.1