Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes the kqueue() backend.

  • Loading branch information...
commit 0798def7eed75b6fb2a0ad1323c34bd9c5965cbe 1 parent 06f9ae1
@alobbs alobbs authored
Showing with 10 additions and 5 deletions.
  1. +10 −5 cherokee/fdpoll-kqueue.c
View
15 cherokee/fdpoll-kqueue.c
@@ -214,7 +214,7 @@ _watch (cherokee_fdpoll_kqueue_t *fdp, int timeout_msecs)
LOG_ERRNO (errno, cherokee_err_error, CHEROKEE_ERROR_FDPOLL_KQUEUE);
return 0;
- } else if (n_events > 0) {
+ } else if (n_events >= 0) {
memset (fdp->fdevents, 0, FDPOLL(fdp)->system_nfiles * sizeof(int));
for (i = 0; i < n_events; ++i) {
@@ -254,11 +254,16 @@ _check (cherokee_fdpoll_kqueue_t *fdp, int fd, int rw_mode)
return 1;
}
- if (rw_mode & poll_mode_read) {
- events |= KQUEUE_READ_EVENT;
+ if ((rw_mode & poll_mode_read) &&
+ (events & KQUEUE_READ_EVENT))
+ {
+ return 1;
}
- if (rw_mode & poll_mode_write) {
- events |= KQUEUE_WRITE_EVENT;
+
+ if ((rw_mode & poll_mode_write) &&
+ (events & KQUEUE_WRITE_EVENT))
+ {
+ return 1;
}
return events;
Please sign in to comment.
Something went wrong with that request. Please try again.