From 98f3446c4351ab935f3ba060b1962326d97ff3a6 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 19 Jan 2012 14:48:38 +0100 Subject: [PATCH] unix: don't close kqueue fd in kqueue_fork() The file descriptor is not inherited by the child process. Trying to close it is not just useless, it's actively harmful - if the close() call succeeds, it will have closed an altogether different file descriptor. --- src/unix/ev/ev_kqueue.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/unix/ev/ev_kqueue.c b/src/unix/ev/ev_kqueue.c index 212ca29a..f03cb808 100644 --- a/src/unix/ev/ev_kqueue.c +++ b/src/unix/ev/ev_kqueue.c @@ -200,8 +200,6 @@ kqueue_destroy (EV_P) void inline_size kqueue_fork (EV_P) { - close (backend_fd); - while ((backend_fd = kqueue ()) < 0) ev_syserr ("(libev) kqueue");