summaryrefslogtreecommitdiff
path: root/ev_epoll.c
diff options
context:
space:
mode:
authorroot <root>2007-11-06 01:17:16 +0000
committerroot <root>2007-11-06 01:17:16 +0000
commitbdffebc95dd4e027a45853749b06f140d6f97ebc (patch)
treeeb285ffe608c4a66d857af7c0c738f65e123b66d /ev_epoll.c
parent692ca25945e1a987acf66bd845ce70a61aa7b160 (diff)
better fork
Diffstat (limited to 'ev_epoll.c')
-rw-r--r--ev_epoll.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/ev_epoll.c b/ev_epoll.c
index 2040103..9f5bd25 100644
--- a/ev_epoll.c
+++ b/ev_epoll.c
@@ -110,15 +110,10 @@ epoll_destroy (EV_P)
static void
epoll_fork (EV_P)
{
- for (;;)
- {
- epoll_fd = epoll_create (256);
-
- if (epoll_fd >= 0)
- break;
+ close (epoll_fd);
- syserr ("(libev) epoll_create");
- }
+ while ((epoll_fd = epoll_create (256)) < 0)
+ syserr ("(libev) epoll_create");
fcntl (epoll_fd, F_SETFD, FD_CLOEXEC);