[llvm] r220717 - Fix bug where sys::Wait could wait on wrong pid.
Rafael Espindola
rafael.espindola at gmail.com
Mon Oct 27 13:30:05 PDT 2014
Author: rafael
Date: Mon Oct 27 15:30:04 2014
New Revision: 220717
URL: http://llvm.org/viewvc/llvm-project?rev=220717&view=rev
Log:
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!
Modified:
llvm/trunk/lib/Support/Unix/Program.inc
Modified: llvm/trunk/lib/Support/Unix/Program.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Program.inc?rev=220717&r1=220716&r2=220717&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Program.inc (original)
+++ llvm/trunk/lib/Support/Unix/Program.inc Mon Oct 27 15:30:04 2014
@@ -335,7 +335,6 @@ ProcessInfo sys::Wait(const ProcessInfo
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
More information about the llvm-commits
mailing list