mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-15 21:59:41 -04:00
BUG/MINOR: mworker: Do not attempt to close(2) fd -1
Valgrind reports:
==3389== Warning: invalid file descriptor -1 in syscall close()
Check for >= 0 before closing.
This bug was introduced in commit ce83b4a5dd
and is specific to 1.9. No backport needed.
This commit is contained in:
parent
da95fd901b
commit
742e0f9f1f
1 changed files with 2 additions and 1 deletions
|
|
@ -3099,7 +3099,8 @@ 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 */
|
||||
close(child->ipc_fd[0]);
|
||||
if (child->ipc_fd[0] >= 0)
|
||||
close(child->ipc_fd[0]);
|
||||
if (child->relative_pid == relative_pid &&
|
||||
child->reloads == 0) {
|
||||
/* keep this struct if this is our pid */
|
||||
|
|
|
|||
Loading…
Reference in a new issue