]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: kqueue: Don't bother closing the kqueue after fork.
authorOlivier Houchard <cognet@ci0.org>
Sun, 26 Nov 2017 18:53:46 +0000 (19:53 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 26 Nov 2017 19:10:58 +0000 (20:10 +0100)
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]

src/ev_kqueue.c

index b61fe6517fb896c569f2ce94c076493861612f0d..b42ee3dd0e8ea74ed86799e72f8cd8f8cca4225f 100644 (file)
@@ -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;