summaryrefslogtreecommitdiff
path: root/ev_kqueue.c
diff options
context:
space:
mode:
Diffstat (limited to 'ev_kqueue.c')
-rw-r--r--ev_kqueue.c13
1 files changed, 11 insertions, 2 deletions
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 */