From 6a101e78e860101ac6b3b9f17bb7a74b181ae736 Mon Sep 17 00:00:00 2001 From: John Barboza Date: Tue, 3 Oct 2017 00:04:48 -0400 Subject: [PATCH] unix: do not close invalid kqueue fd after fork The kqueue documentation states that the file descriptor is not inherited by the child process. Hence, do not close it in uv_loop_fork to avoid tampering with a possibly valid file descriptor already opened by the child process. PR-URL: https://github.com/libuv/libuv/pull/1583 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: Santiago Gimeno --- src/unix/kqueue.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/unix/kqueue.c b/src/unix/kqueue.c index c9adddbd..5e89bdce 100644 --- a/src/unix/kqueue.c +++ b/src/unix/kqueue.c @@ -65,7 +65,6 @@ static int uv__has_forked_with_cfrunloop; int uv__io_fork(uv_loop_t* loop) { int err; - uv__close(loop->backend_fd); loop->backend_fd = -1; err = uv__kqueue_init(loop); if (err)