From: Rafael Espindola Date: Mon, 27 Oct 2014 20:30:04 +0000 (+0000) Subject: Fix bug where sys::Wait could wait on wrong pid. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f13d6461b2018ccbeea46203d271d590e22638c;p=platform%2Fupstream%2Fllvm.git 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! llvm-svn: 220717 --- diff --git a/llvm/lib/Support/Unix/Program.inc b/llvm/lib/Support/Unix/Program.inc index 905c78f..7bf6ece 100644 --- a/llvm/lib/Support/Unix/Program.inc +++ b/llvm/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