Whamcloud - gitweb
LU-1585 lnet: Fix an incorrect timestamp calculation in lst.c
authorDoug Oucharek <doug@whamcloud.com>
Thu, 26 Jul 2012 05:21:46 +0000 (22:21 -0700)
committerJohann Lombardi <johann.lombardi@intel.com>
Mon, 1 Oct 2012 10:37:11 +0000 (06:37 -0400)
The operation in routine lst_timeval_diff() (in lst.c) has
a bug. It uses tv_sec where it should be using tv_usec.

Signed-off-by: Doug Oucharek <doug@whamcloud.com>
Change-Id: I898dacd3d4a2c84594148d0514fda731d24a49bf
Reviewed-on: http://review.whamcloud.com/3474
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Liang Zhen <liang@whamcloud.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
lnet/utils/lst.c

index 38ca68b..fa880b1 100644 (file)
@@ -1570,7 +1570,7 @@ lst_timeval_diff(struct timeval *tv1,
         }
 
         df->tv_sec  = tv1->tv_sec - 1 - tv2->tv_sec;
-        df->tv_usec = tv1->tv_sec + 1000000 - tv2->tv_usec;
+        df->tv_usec = tv1->tv_usec + 1000000 - tv2->tv_usec;
 
         return;
 }