From: Olivier Houchard Date: Sun, 26 Nov 2017 18:53:46 +0000 (+0100) Subject: BUG/MEDIUM: kqueue: Don't bother closing the kqueue after fork. X-Git-Tag: v1.9-dev1~651 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba8e8c351866947c5fe4dac4db433c6a3d04ff7f;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: kqueue: Don't bother closing the kqueue after fork. kqueue fd's are not shared with children after fork(), so the children don't have to close them, and it may in fact be dangerous, because we may end up closing a totally unrelated fd. [wt: to be backported to 1.8 where master-worker broke on this, and likely to older versions for completeness] --- diff --git a/src/ev_kqueue.c b/src/ev_kqueue.c index b61fe6517f..b42ee3dd0e 100644 --- a/src/ev_kqueue.c +++ b/src/ev_kqueue.c @@ -216,8 +216,6 @@ REGPRM1 static int _do_test(struct poller *p) */ REGPRM1 static int _do_fork(struct poller *p) { - if (kqueue_fd >= 0) - close(kqueue_fd); kqueue_fd = kqueue(); if (kqueue_fd < 0) return 0;