tv_add bug?

Bai Weidong baiwd at cn.fujitsu.com
Thu Jul 12 02:31:47 UTC 2007


hello,
Thanks for providing strace. However, I am afraid whether
there is some minor error. with tv_add. In my opinion, it'd be
a little better with the following change.

Signed-off-by: "Bai Weidong" <baiwd at cn.fujitsu.com>

--- utilold.c	2007-07-12 10:14:09.000000000 +0800
+++ util.c	2007-07-12 10:22:27.000000000 +0800
@@ -193,7 +193,7 @@ struct timeval *tv, *a, *b;
 {
 	tv->tv_sec = a->tv_sec + b->tv_sec;
 	tv->tv_usec = a->tv_usec + b->tv_usec;
-	if (tv->tv_usec > 1000000) {
+	if (tv->tv_usec >= 1000000) {
 		tv->tv_sec++;
 		tv->tv_usec -= 1000000;
 	}

Best Regards






More information about the Strace-devel mailing list