diff --git a/lib/System/Unix/Program.inc b/lib/System/Unix/Program.inc index 56dea250a77..c52f3a88c04 100644 --- a/lib/System/Unix/Program.inc +++ b/lib/System/Unix/Program.inc @@ -244,7 +244,7 @@ Program::Wait(unsigned secondsToWait, int status; uint64_t pid = reinterpret_cast(Data_); pid_t child = static_cast(pid); - while (wait(&status) != child) + while (waitpid(pid, &status, 0) != child) if (secondsToWait && errno == EINTR) { // Kill the child. kill(child, SIGKILL);