mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
BUG/MINOR: mworker: only write to pidfile if it exists
A missing test causes a write(-1, $PID) to appear in strace output when in master-worker mode. This is totally harmless though. This fix must be backported to 1.8.
This commit is contained in:
parent
1605c7ae61
commit
46ec48bc1a
@ -2786,7 +2786,8 @@ int main(int argc, char **argv)
|
|||||||
if (global.mode & MODE_MWORKER) {
|
if (global.mode & MODE_MWORKER) {
|
||||||
char pidstr[100];
|
char pidstr[100];
|
||||||
snprintf(pidstr, sizeof(pidstr), "%d\n", getpid());
|
snprintf(pidstr, sizeof(pidstr), "%d\n", getpid());
|
||||||
shut_your_big_mouth_gcc(write(pidfd, pidstr, strlen(pidstr)));
|
if (pidfd >= 0)
|
||||||
|
shut_your_big_mouth_gcc(write(pidfd, pidstr, strlen(pidstr)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the father launches the required number of processes */
|
/* the father launches the required number of processes */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user