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);
static void
kqueue_fork (EV_P)
{
- for (;;)
- {
- kqueue_fd = kqueue ();
-
- if (kqueue_fd >= 0)
- break;
+ close (kqueue_fd);
- syserr ("(libev) kqueue");
- }
+ while ((kqueue_fd = kqueue ()) < 0)
+ syserr ("(libev) kqueue");
fcntl (kqueue_fd, F_SETFD, FD_CLOEXEC);