X-Git-Url: https://git.llucax.com/software/libev.git/blobdiff_plain/deff62d26ff4c1324816c04c0c6db1e4db435870..692ca25945e1a987acf66bd845ce70a61aa7b160:/ev_kqueue.c?ds=sidebyside diff --git a/ev_kqueue.c b/ev_kqueue.c index 4fefcee..07d16e4 100644 --- a/ev_kqueue.c +++ b/ev_kqueue.c @@ -87,7 +87,7 @@ kqueue_poll (EV_P_ ev_tstamp timeout) if (res < 0) { if (errno != EINTR) - syserr (); + syserr ("(libev) kevent"); return; } @@ -185,7 +185,16 @@ kqueue_destroy (EV_P) static void kqueue_fork (EV_P) { - kqueue_fd = kqueue (); + for (;;) + { + kqueue_fd = kqueue (); + + if (kqueue_fd >= 0) + break; + + syserr ("(libev) kqueue"); + } + fcntl (kqueue_fd, F_SETFD, FD_CLOEXEC); /* re-register interest in fds */