From: Helmut Schaa Date: Wed, 24 Jul 2013 12:51:55 +0000 (+0200) Subject: uloop: Fix incorrect timeout X-Git-Url: https://git.archive.openwrt.org/?p=project%2Flibubox.git;a=commitdiff_plain;h=510e4956e58727d68fbf7dea1646a344d6901c91 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 --- diff --git a/uloop.c b/uloop.c index 54ebe8d..deb08a3 100644 --- a/uloop.c +++ b/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)); } }