Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
kqueue: ignore ENOENT error
Browse files Browse the repository at this point in the history
File descriptor might be closed during callback, all events that was reported
before the callback are not valid and trying to remove them will result
in ENOENT. This error can be safely ignored.
  • Loading branch information
indutny committed Dec 18, 2012
1 parent 273cecc commit b86ed94
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/unix/kqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
/* TODO batch up */
struct kevent events[1];
EV_SET(events + 0, fd, ev->filter, EV_DELETE, 0, 0, 0);
if (kevent(loop->backend_fd, events, 1, NULL, 0, NULL)) abort();
if (kevent(loop->backend_fd, events, 1, NULL, 0, NULL))
if (errno != ENOENT)
abort();
}
}

Expand All @@ -208,7 +210,9 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
/* TODO batch up */
struct kevent events[1];
EV_SET(events + 0, fd, ev->filter, EV_DELETE, 0, 0, 0);
if (kevent(loop->backend_fd, events, 1, NULL, 0, NULL)) abort();
if (kevent(loop->backend_fd, events, 1, NULL, 0, NULL))
if (errno != ENOENT)
abort();
}
}

Expand Down

0 comments on commit b86ed94

Please sign in to comment.