[PATCH] fix bug where sys::Wait could wait on wrong pid

Daniel Reynaud dreynaud at apple.com
Fri Sep 5 10:15:39 PDT 2014


I see no reason to set ChildPid to -1 when WaitUntilTerminates is true. 

If there was some other unwaited-for child process that terminates before PI.Pid, its pid would be returned instead of PI.Pid so the function would return "Error waiting for child process", even though errno is 0.

By making we wait on the right process, this works as expected.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: waitpid.diff
Type: application/octet-stream
Size: 585 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140905/d4cbf756/attachment.obj>


More information about the llvm-commits mailing list