From: Felix Fietkau Date: Sat, 17 Jun 2017 09:47:21 +0000 (+0200) Subject: uloop: allow passing 0 as timeout to uloop_run X-Git-Url: http://git.archive.openwrt.org/?p=project%2Flibubox.git;a=commitdiff_plain;h=fd57eea9f37e447814afbf934db626288aac23c4;hp=4bc3decf8743c0add93d434a639bb1b449b6da11 uloop: allow passing 0 as timeout to uloop_run Useful for processing only immediate timers and fds Signed-off-by: Felix Fietkau --- diff --git a/uloop.c b/uloop.c index 0c57753..d2f41bb 100644 --- a/uloop.c +++ b/uloop.c @@ -548,7 +548,7 @@ int uloop_run_timeout(int timeout) uloop_gettime(&tv); next_time = uloop_get_next_timeout(&tv); - if (timeout > 0 && timeout < next_time) + if (timeout >= 0 && timeout < next_time) next_time = timeout; uloop_run_events(next_time); }