This address: PR 5277 (Program::Wait is unsafe to call from multiple threads).
Note: If waitpid() turns out to be non-portable, we can add more autoconf magic, or look into
another solution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84903
91177308-0d34-0410-b5e6-
96231b3b80d8
int status;
uint64_t pid = reinterpret_cast<uint64_t>(Data_);
pid_t child = static_cast<pid_t>(pid);
- while (wait(&status) != child)
+ while (waitpid(pid, &status, 0) != child)
if (secondsToWait && errno == EINTR) {
// Kill the child.
kill(child, SIGKILL);