Fix the kqueue poller backend

This commit is contained in:
Přemysl Eric Janouch 2016-01-04 00:54:27 +01:00
parent 6a19b51516
commit 8c06ec3276
1 changed files with 3 additions and 3 deletions

View File

@ -1848,10 +1848,10 @@ poller_run (struct poller *self)
int n_fds; int n_fds;
do do
{ {
struct timespec ts = poller_timeout_to_timespec int timeout = poller_common_get_timeout (&self->common);
(poller_common_get_timeout (&self->common)); struct timespec ts = poller_timeout_to_timespec (timeout);
n_fds = kevent (self->kqueue_fd, n_fds = kevent (self->kqueue_fd,
NULL, 0, self->revents, self->len, &ts); NULL, 0, self->revents, self->len, timeout < 0 ? NULL : &ts);
} }
while (n_fds == -1 && errno == EINTR); while (n_fds == -1 && errno == EINTR);