uloop: fix tv_diff() calculation
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
parent
0385cbc068
commit
407f7a0bb3
1 changed files with 3 additions and 4 deletions
7
uloop.c
7
uloop.c
|
@ -304,10 +304,9 @@ out:
|
||||||
|
|
||||||
static int tv_diff(struct timeval *t1, struct timeval *t2)
|
static int tv_diff(struct timeval *t1, struct timeval *t2)
|
||||||
{
|
{
|
||||||
if (t1->tv_sec != t2->tv_sec)
|
return
|
||||||
return (t1->tv_sec - t2->tv_sec) * 1000;
|
(t1->tv_sec - t2->tv_sec) * 1000 +
|
||||||
else
|
(t1->tv_usec - t2->tv_usec) / 1000;
|
||||||
return (t1->tv_usec - t2->tv_usec) / 1000;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int uloop_timeout_add(struct uloop_timeout *timeout)
|
int uloop_timeout_add(struct uloop_timeout *timeout)
|
||||||
|
|
Loading…
Reference in a new issue