uloop: fix a regression in timeout handling

Variable confusion was breaking timers

Fixes: 368fd26458 ("uloop: allow specifying a timeout for uloop_run()")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2017-06-17 11:39:24 +02:00
parent 6a7fb7d8df
commit 4bc3decf87

View file

@ -548,9 +548,9 @@ int uloop_run_timeout(int timeout)
uloop_gettime(&tv); uloop_gettime(&tv);
next_time = uloop_get_next_timeout(&tv); next_time = uloop_get_next_timeout(&tv);
if (timeout > 0 && next_time < timeout) if (timeout > 0 && timeout < next_time)
timeout = next_time; next_time = timeout;
uloop_run_events(timeout); uloop_run_events(next_time);
} }
if (!--uloop_run_depth) if (!--uloop_run_depth)