uloop: fix immediate timeout processing on mac os x
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
parent
7157c3a4df
commit
e7825661a2
1 changed files with 2 additions and 2 deletions
4
uloop.c
4
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;
|
||||
|
|
Loading…
Reference in a new issue