Whamcloud - gitweb
LU-1585 lnet: Fix an incorrect timestamp calculation in lst.c
authorDoug Oucharek <doug@whamcloud.com>
Thu, 26 Jul 2012 00:11:04 +0000 (17:11 -0700)
committerOleg Drokin <green@whamcloud.com>
Thu, 2 Aug 2012 22:34:22 +0000 (18:34 -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: I8886428253b62562840aa37842e33b63a29be56b
Reviewed-on: http://review.whamcloud.com/3472
Reviewed-by: Liang Zhen <liang@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Isaac Huang <iclaymore@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/utils/lst.c

index 94cf02a..d420894 100644 (file)
@@ -1567,7 +1567,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;
 }