* eina: fix gettimeofday usage.
authorcedric <cedric>
Fri, 3 Dec 2010 16:30:26 +0000 (16:30 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 3 Dec 2010 16:30:26 +0000 (16:30 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@55197 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/eina_counter.c

index daad1f7..32d2a2a 100644 (file)
@@ -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