X-Git-Url: https://git.llucax.com/software/libev.git/blobdiff_plain/deff62d26ff4c1324816c04c0c6db1e4db435870..e7d1fc1a4bbd47e0d2f7d59d1ce4ccaa4fa0ab10:/ev_kqueue.c diff --git a/ev_kqueue.c b/ev_kqueue.c index 4fefcee..8d5021f 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,11 @@ kqueue_destroy (EV_P) static void kqueue_fork (EV_P) { - kqueue_fd = kqueue (); + close (kqueue_fd); + + while ((kqueue_fd = kqueue ()) < 0) + syserr ("(libev) kqueue"); + fcntl (kqueue_fd, F_SETFD, FD_CLOEXEC); /* re-register interest in fds */