From fb1c587ddeada42296dff0d3991b5a40b4e656f7 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Fri, 3 Dec 2010 16:30:26 +0000 Subject: [PATCH] * eina: fix gettimeofday usage. SVN revision: 55197 --- legacy/eina/src/lib/eina_counter.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/legacy/eina/src/lib/eina_counter.c b/legacy/eina/src/lib/eina_counter.c index daad1f7095..32d2a2a7d1 100644 --- a/legacy/eina/src/lib/eina_counter.c +++ b/legacy/eina/src/lib/eina_counter.c @@ -87,7 +87,15 @@ _eina_counter_time_get(Eina_Nano_Time *tp) # elif defined(CLOCK_REALTIME) return clock_gettime(CLOCK_REALTIME, tp); # else - return gettimeofday(tp, NULL); + struct timeval tv; + + if (gettimeofday(tp, NULL)) + return -1; + + tp->tv_sec = tv.tv_sec; + tp->tv_nsec = tv.tv_usec * 1000L; + + return 0; # endif } #else