better fork

master
Marc Alexander Lehmann 2007-11-06 01:17:16 +00:00
parent 8505ed3835
commit 0daa9a9b8e
2 changed files with 6 additions and 16 deletions

View File

@ -110,15 +110,10 @@ epoll_destroy (EV_P)
static void
epoll_fork (EV_P)
{
for (;;)
{
epoll_fd = epoll_create (256);
close (epoll_fd);
if (epoll_fd >= 0)
break;
syserr ("(libev) epoll_create");
}
while ((epoll_fd = epoll_create (256)) < 0)
syserr ("(libev) epoll_create");
fcntl (epoll_fd, F_SETFD, FD_CLOEXEC);

View File

@ -185,15 +185,10 @@ kqueue_destroy (EV_P)
static void
kqueue_fork (EV_P)
{
for (;;)
{
kqueue_fd = kqueue ();
close (kqueue_fd);
if (kqueue_fd >= 0)
break;
syserr ("(libev) kqueue");
}
while ((kqueue_fd = kqueue ()) < 0)
syserr ("(libev) kqueue");
fcntl (kqueue_fd, F_SETFD, FD_CLOEXEC);