- fcntl (kqueue_fd, F_SETFD, FD_CLOEXEC); /* not sure if necessary, hopefully doesn't hurt */
-
- /* Check for Mac OS X kqueue bug. */
- ch.ident = -1;
- ch.filter = EVFILT_READ;
- ch.flags = EV_ADD;
-
- /*
- * If kqueue works, then kevent will succeed, and it will
- * stick an error in ev. If kqueue is broken, then
- * kevent will fail.
- */
- if (kevent (kqueue_fd, &ch, 1, &ev, 1, 0) != 1
- || ev.ident != -1
- || ev.flags != EV_ERROR)
- {
- /* detected broken kqueue */
- close (kqueue_fd);
- return 0;
- }
+ fcntl (backend_fd, F_SETFD, FD_CLOEXEC); /* not sure if necessary, hopefully doesn't hurt */