summaryrefslogtreecommitdiff
path: root/ev_kqueue.c
diff options
context:
space:
mode:
authorroot <root>2007-11-06 00:52:32 +0000
committerroot <root>2007-11-06 00:52:32 +0000
commit499c7e995433fedd0a2333ec6d9bc3768e6224f4 (patch)
tree63804fd270e45b25889a1d3a380e3912ada25a4b /ev_kqueue.c
parentdeff62d26ff4c1324816c04c0c6db1e4db435870 (diff)
better fork
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 */