projects
/
project
/
libubox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
0385cbc
)
uloop: fix tv_diff() calculation
author
Felix Fietkau
<nbd@openwrt.org>
Wed, 31 Oct 2012 19:28:11 +0000
(20:28 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Wed, 31 Oct 2012 19:28:15 +0000
(20:28 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
uloop.c
patch
|
blob
|
history
diff --git
a/uloop.c
b/uloop.c
index
6bc974d
..
a28bce8
100644
(file)
--- a/
uloop.c
+++ b/
uloop.c
@@
-304,10
+304,9
@@
out:
static int tv_diff(struct timeval *t1, struct timeval *t2)
{
- if (t1->tv_sec != t2->tv_sec)
- return (t1->tv_sec - t2->tv_sec) * 1000;
- else
- return (t1->tv_usec - t2->tv_usec) / 1000;
+ return
+ (t1->tv_sec - t2->tv_sec) * 1000 +
+ (t1->tv_usec - t2->tv_usec) / 1000;
}
int uloop_timeout_add(struct uloop_timeout *timeout)