Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Schaa <helmut.schaa@googlemail.com>2013-07-24 16:51:55 +0400
committerFelix Fietkau <nbd@openwrt.org>2013-07-24 17:01:19 +0400
commit510e4956e58727d68fbf7dea1646a344d6901c91 (patch)
tree45ed9d20a6c705b9262452cb4f49333903629e71 /uloop.c
parent11e8afea0f7eb34f8c23a8e589ee659c46f3f8aa (diff)
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>
Diffstat (limited to 'uloop.c')
-rw-r--r--uloop.c1
1 files changed, 1 insertions, 0 deletions
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));
}
}