From f6066a7fd359459256ad8d589a74e02af462c982 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 27 Oct 2014 20:30:04 +0000 Subject: [PATCH] Fix bug where sys::Wait could wait on wrong pid. Setting ChildPid to -1 would cause waitpid to wait for any child process. Patch by Daniel Reynaud! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220717 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Unix/Program.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/Support/Unix/Program.inc b/lib/Support/Unix/Program.inc index 905c78f79bc..7bf6eceda73 100644 --- a/lib/Support/Unix/Program.inc +++ b/lib/Support/Unix/Program.inc @@ -335,7 +335,6 @@ ProcessInfo sys::Wait(const ProcessInfo &PI, unsigned SecondsToWait, pid_t ChildPid = PI.Pid; if (WaitUntilTerminates) { SecondsToWait = 0; - ChildPid = -1; // mimic a wait() using waitpid() } else if (SecondsToWait) { // Install a timeout handler. The handler itself does nothing, but the // simple fact of having a handler at all causes the wait below to return -- 2.34.1