BUG/MEDIUM: init: 'devnullfd' not properly closed for master

Since commit "1ec59d3 MINOR: init: Make devnullfd global and create it
earlier in init" the devnullfd pointing towards /dev/null gets created
early in the init process but it was closed after the call to
"mworker_run_master". The master process never got to the FD closing
code and we had an FD leak.

This patch does not need to be backported.
This commit is contained in:
Remi Tricot-Le Breton 2025-11-12 15:58:33 +01:00 committed by William Lallemand
parent 7927ee95f3
commit 1b19e4ef32

View File

@ -1151,6 +1151,9 @@ void mworker_run_master(void)
{ {
struct mworker_proc *child, *it; struct mworker_proc *child, *it;
close(devnullfd);
devnullfd = -1;
proc_self->failedreloads = 0; /* reset the number of failure */ proc_self->failedreloads = 0; /* reset the number of failure */
mworker_loop(); mworker_loop();
#if defined(USE_OPENSSL) && !defined(OPENSSL_NO_DH) #if defined(USE_OPENSSL) && !defined(OPENSSL_NO_DH)