aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-01-04 00:54:27 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2016-01-04 00:54:27 +0100
commit8c06ec3276ff10f8b970a83467e0b3c4e28f4f5f (patch)
tree08035a99aa8904a1dbd862dd55dcb5df399104b8
parent6a19b515166f88c6909cac99e67a2a62239e4395 (diff)
downloadliberty-8c06ec3276ff10f8b970a83467e0b3c4e28f4f5f.tar.gz
liberty-8c06ec3276ff10f8b970a83467e0b3c4e28f4f5f.tar.xz
liberty-8c06ec3276ff10f8b970a83467e0b3c4e28f4f5f.zip
Fix the kqueue poller backend
-rw-r--r--liberty.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/liberty.c b/liberty.c
index e54cfec..78371f5 100644
--- a/liberty.c
+++ b/liberty.c
@@ -1848,10 +1848,10 @@ poller_run (struct poller *self)
int n_fds;
do
{
- struct timespec ts = poller_timeout_to_timespec
- (poller_common_get_timeout (&self->common));
+ int timeout = poller_common_get_timeout (&self->common);
+ struct timespec ts = poller_timeout_to_timespec (timeout);
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);