From 46e9c5104c00b487eb5eeb8fed5f14dcd6e3352a Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 4 Jul 2023 09:34:29 +0200 Subject: [PATCH] Use waitpid(-1) over WAIT_ANY This macro is only available in glibc. Closes GH-11588 --- ext/pcntl/pcntl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index 7a04db4bcc6..4eedbc574e5 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -1360,7 +1360,7 @@ static void pcntl_signal_handler(int signo) errno = 0; /* Although Linux specifies that WNOHANG will never result in EINTR, POSIX doesn't say so: * https://pubs.opengroup.org/onlinepubs/9699919799/functions/waitpid.html */ - pid = waitpid(WAIT_ANY, &status, WNOHANG | WUNTRACED); + pid = waitpid(-1, &status, WNOHANG | WUNTRACED); } while (pid <= 0 && errno == EINTR); if (pid <= 0) { if (UNEXPECTED(!psig)) {