Fix bug where sys::Wait could wait on wrong pid.
[oota-llvm.git] / lib / Support / Unix / Program.inc
index 905c78f79bc323916eb4ac67ee7d21e278dbfc0c..7bf6eceda73389b35f75037abc72aa787e9e3527 100644 (file)
@@ -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