uloop: Fix incorrect timeout
uloop timeouts are calculated based on a time value that was fetched before any callbacks were executed. Hence, the next timeout is off by the time the callback execution took which can lead to strange side effects. Fix this by calculating the next timeout based on a fresh time value. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
This commit is contained in:
parent
11e8afea0f
commit
510e4956e5
1 changed files with 1 additions and 0 deletions
1
uloop.c
1
uloop.c
|
@ -632,6 +632,7 @@ void uloop_run(void)
|
|||
|
||||
if (do_sigchld)
|
||||
uloop_handle_processes();
|
||||
uloop_gettime(&tv);
|
||||
uloop_run_events(uloop_get_next_timeout(&tv));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue