From 0ebd182186d09eecfee0660d8a3b8d31d75fb23f Mon Sep 17 00:00:00 2001 From: green Date: Sun, 25 Feb 2007 22:51:00 +0000 Subject: [PATCH] b=11028 r=adilger Fix cfs_timeval_sub to properly fill struct timeval. Correctly assign microseconds to microsecondsand seconds to seconds. --- lnet/include/libcfs/libcfs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lnet/include/libcfs/libcfs.h b/lnet/include/libcfs/libcfs.h index 8ac781b..a4127bf 100644 --- a/lnet/include/libcfs/libcfs.h +++ b/lnet/include/libcfs/libcfs.h @@ -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; } -- 1.8.3.1