Whamcloud - gitweb
b=11028
authorgreen <green>
Sun, 25 Feb 2007 22:51:00 +0000 (22:51 +0000)
committergreen <green>
Sun, 25 Feb 2007 22:51:00 +0000 (22:51 +0000)
r=adilger

Fix cfs_timeval_sub to properly fill struct timeval.
Correctly assign microseconds to microsecondsand seconds to seconds.

lnet/include/libcfs/libcfs.h

index 8ac781b..a4127bf 100644 (file)
@@ -419,8 +419,8 @@ static inline long cfs_timeval_sub(struct timeval *large, struct timeval *small,
                 (large->tv_sec - small->tv_sec) * ONE_MILLION +
                 (large->tv_usec - small->tv_usec));
         if (result != NULL) {
-                result->tv_usec = r / ONE_MILLION;
-                result->tv_sec = r;
+                result->tv_usec = r % ONE_MILLION;
+                result->tv_sec = r / ONE_MILLION;
         }
         return r;
 }