summaryrefslogtreecommitdiff
path: root/ev_kqueue.c
diff options
context:
space:
mode:
Diffstat (limited to 'ev_kqueue.c')
-rw-r--r--ev_kqueue.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/ev_kqueue.c b/ev_kqueue.c
index 07d16e4..8d5021f 100644
--- a/ev_kqueue.c
+++ b/ev_kqueue.c
@@ -185,15 +185,10 @@ kqueue_destroy (EV_P)
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);