uloop: fix sub-second timer offsets for uloop_timeout_set
This commit is contained in:
parent
a9b44ebe55
commit
33b9f3aa0b
1 changed files with 1 additions and 1 deletions
2
uloop.c
2
uloop.c
|
@ -341,7 +341,7 @@ int uloop_timeout_set(struct uloop_timeout *timeout, int msecs)
|
||||||
gettimeofday(&timeout->time, NULL);
|
gettimeofday(&timeout->time, NULL);
|
||||||
|
|
||||||
time->tv_sec += msecs / 1000;
|
time->tv_sec += msecs / 1000;
|
||||||
time->tv_usec += msecs % 1000;
|
time->tv_usec += (msecs % 1000) * 1000;
|
||||||
|
|
||||||
if (time->tv_usec > 1000000) {
|
if (time->tv_usec > 1000000) {
|
||||||
time->tv_sec++;
|
time->tv_sec++;
|
||||||
|
|
Loading…
Reference in a new issue