[pisa-src] r2159 - trunk/libpisa/sysdep.h

  • From: Mircea Gherzan <mircea.gherzan@xxxxxxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Wed, 17 Mar 2010 19:25:57 +0100

Author: gherzan
Date: Wed Mar 17 19:25:57 2010
New Revision: 2159

Log:
libpisa: small rework of the clock_gettime emulation

Modified:
   trunk/libpisa/sysdep.h

Modified: trunk/libpisa/sysdep.h
==============================================================================
--- trunk/libpisa/sysdep.h      Wed Mar 17 19:19:50 2010        (r2158)
+++ trunk/libpisa/sysdep.h      Wed Mar 17 19:25:57 2010        (r2159)
@@ -52,14 +52,12 @@
 
     /* well... we can live with a lower time resolution, right? */
     err = gettimeofday(&tv, NULL);
-    if (err) {
-        return err;
+    if (!err) {
+        ts.tv_sec  = tv.tv_sec;
+        ts.tv_nsec = tv.tv_usec * 1000;
     }
 
-    ts.tv_sec  = tv.tv_sec;
-    ts.tv_nsec = tv.tv_usec * 1000;
-
-    return 0;
+    return err;
 }
 #endif /* HAVE_CLOCK_GETTIME */
 

Other related posts:

  • » [pisa-src] r2159 - trunk/libpisa/sysdep.h - Mircea Gherzan