From: Felix Fietkau Date: Tue, 1 Jan 2013 22:37:17 +0000 (+0100) Subject: uloop: fix immediate timeout processing on mac os x X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e7825661a2a5239c05bf0e250cd0d9c1eed6419d;p=oweals%2Flibubox.git uloop: fix immediate timeout processing on mac os x Signed-off-by: Felix Fietkau --- diff --git a/uloop.c b/uloop.c index 88e9c81..f4f5e02 100644 --- a/uloop.c +++ b/uloop.c @@ -136,12 +136,12 @@ static void uloop_run_events(int timeout) struct timespec ts; int nfds, n; - if (timeout > 0) { + if (timeout >= 0) { ts.tv_sec = timeout / 1000; ts.tv_nsec = (timeout % 1000) * 1000000; } - nfds = kevent(poll_fd, NULL, 0, events, ARRAY_SIZE(events), timeout > 0 ? &ts : NULL); + nfds = kevent(poll_fd, NULL, 0, events, ARRAY_SIZE(events), timeout >= 0 ? &ts : NULL); for(n = 0; n < nfds; ++n) { struct uloop_fd *u = events[n].udata;