summaryrefslogtreecommitdiff
path: root/ev_epoll.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_epoll.c
parentdeff62d26ff4c1324816c04c0c6db1e4db435870 (diff)
better fork
Diffstat (limited to 'ev_epoll.c')
-rw-r--r--ev_epoll.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/ev_epoll.c b/ev_epoll.c
index 6bb41bc..2040103 100644
--- a/ev_epoll.c
+++ b/ev_epoll.c
@@ -57,7 +57,7 @@ epoll_poll (EV_P_ ev_tstamp timeout)
if (eventcnt < 0)
{
if (errno != EINTR)
- syserr ();
+ syserr ("(libev) epoll_wait");
return;
}
@@ -110,7 +110,16 @@ epoll_destroy (EV_P)
static void
epoll_fork (EV_P)
{
- epoll_fd = epoll_create (256);
+ for (;;)
+ {
+ epoll_fd = epoll_create (256);
+
+ if (epoll_fd >= 0)
+ break;
+
+ syserr ("(libev) epoll_create");
+ }
+
fcntl (epoll_fd, F_SETFD, FD_CLOEXEC);
fd_rearm_all (EV_A);