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]
This commit is contained in:
Olivier Houchard 2017-11-26 19:53:46 +01:00 committed by Willy Tarreau
parent b306650c2a
commit ba8e8c3518

View 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;