git.samba.org
/
abartlet
/
samba.git
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
014a3a9
)
Fixing timeval calculation
author
Simo Sorce
<ssorce@redhat.com>
Fri, 25 Sep 2009 14:59:04 +0000
(10:59 -0400)
committer
Simo Sorce
<ssorce@redhat.com>
Fri, 25 Sep 2009 15:00:19 +0000
(11:00 -0400)
The code was always doubling microseconds when attempting to round up.
lib/tevent/tevent_timed.c
patch
|
blob
|
history
diff --git
a/lib/tevent/tevent_timed.c
b/lib/tevent/tevent_timed.c
index d75653d847bbbc67528856bc664acff38dbad102..cc51bf60d5977fbd13c5cbf616cb98a02a9edcdd 100644
(file)
--- a/
lib/tevent/tevent_timed.c
+++ b/
lib/tevent/tevent_timed.c
@@
-114,7
+114,7
@@
struct timeval tevent_timeval_add(const struct timeval *tv, uint32_t secs,
tv2.tv_sec += secs;
tv2.tv_usec += usecs;
tv2.tv_sec += tv2.tv_usec / 1000000;
- tv2.tv_usec
+
= tv2.tv_usec % 1000000;
+ tv2.tv_usec = tv2.tv_usec % 1000000;
return tv2;
}