From 9ea2b6ae8c7383f911f3f7071e8c031ded129b10 Mon Sep 17 00:00:00 2001 From: cedric Date: Fri, 3 Dec 2010 16:30:26 +0000 Subject: [PATCH] * eina: fix gettimeofday usage. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@55197 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/eina_counter.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib/eina_counter.c b/src/lib/eina_counter.c index daad1f7..32d2a2a 100644 --- a/src/lib/eina_counter.c +++ b/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 -- 2.7.4