diff options
author | Felix Fietkau <nbd@nbd.name> | 2017-06-17 12:39:24 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2017-06-17 12:40:11 +0300 |
commit | 4bc3decf8743c0add93d434a639bb1b449b6da11 (patch) | |
tree | b066c5860519fa78eabba9330f022fac1c3b49d3 /uloop.c | |
parent | 6a7fb7d8df308d18167051447fa489de389588df (diff) |
uloop: fix a regression in timeout handling
Variable confusion was breaking timers
Fixes: 368fd2645878 ("uloop: allow specifying a timeout for uloop_run()")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'uloop.c')
-rw-r--r-- | uloop.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -548,9 +548,9 @@ int uloop_run_timeout(int timeout) uloop_gettime(&tv); next_time = uloop_get_next_timeout(&tv); - if (timeout > 0 && next_time < timeout) - timeout = next_time; - uloop_run_events(timeout); + if (timeout > 0 && timeout < next_time) + next_time = timeout; + uloop_run_events(next_time); } if (!--uloop_run_depth) |