From: William Lallemand Date: Fri, 28 Jan 2022 20:56:24 +0000 (+0100) Subject: MINOR: mworker: set the master side of ipc_fd in the worker to -1 X-Git-Tag: v2.6-dev1~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e01878e4591b36218dad1326662704476982523;p=thirdparty%2Fhaproxy.git MINOR: mworker: set the master side of ipc_fd in the worker to -1 Once the child->ipc_fd[0] is closed in the worker, set the value to -1 so we don't reference a closed FD anymore. --- diff --git a/src/haproxy.c b/src/haproxy.c index 70ce708f3e..eb6c520e62 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -3302,8 +3302,10 @@ int main(int argc, char **argv) * workers, we don't need to close the worker * side of other workers since it's done with * the bind_proc */ - if (child->ipc_fd[0] >= 0) + if (child->ipc_fd[0] >= 0) { close(child->ipc_fd[0]); + child->ipc_fd[0] = -1; + } if (child->options & PROC_O_TYPE_WORKER && child->reloads == 0) { /* keep this struct if this is our pid */