summaryrefslogtreecommitdiff
path: root/kqueue.c
diff options
context:
space:
mode:
authorMark Mentovai <mark@chromium.org>2016-07-08 09:43:39 -0400
committerAzat Khuzhin <a3at.mail@gmail.com>2016-07-12 20:06:52 +0300
commitdf6f99e5b51a3c0786f54cb9822604ec63385400 (patch)
tree71afcbe1b74565f7fecfc1c8f8d27fbe2022e3c8 /kqueue.c
parent8892f4cbefcccffdae01d0995e4c6b39b241f3cc (diff)
downloadlibevent-df6f99e5b51a3c0786f54cb9822604ec63385400.tar.gz
Check for Mac OS X 10.4 kqueue bug properly
EV_ERROR is a bit in struct kevent::flags. Other bits may be set too. Actually we have osx builds on travis-ci, but it uses osx 10.9.5, and we don't have warnings there, since I guess that there is no OR'ing with previous flag in case of error, while in 10.12 there is OR. Fixes: #377 Fixes: #376 Link: https://crbug.com/626534 Link: https://travis-ci.org/libevent/libevent/jobs/141033429
Diffstat (limited to 'kqueue.c')
-rw-r--r--kqueue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kqueue.c b/kqueue.c
index 1f41b5a7..a959c58a 100644
--- a/kqueue.c
+++ b/kqueue.c
@@ -154,7 +154,7 @@ kq_init(struct event_base *base)
if (kevent(kq,
kqueueop->changes, 1, kqueueop->events, NEVENT, NULL) != 1 ||
(int)kqueueop->events[0].ident != -1 ||
- kqueueop->events[0].flags != EV_ERROR) {
+ !(kqueueop->events[0].flags & EV_ERROR)) {
event_warn("%s: detected broken kqueue; not using.", __func__);
goto err;
}