| commit | b3982fc8be5cac77e572fc540addd9d489b42698 | [log] [tgz] |
|---|---|---|
| author | Peter Collingbourne <pcc@google.com> | Thu Apr 15 21:42:37 2021 -0700 |
| committer | Peter Collingbourne <pcc@google.com> | Thu Apr 15 21:47:07 2021 -0700 |
| tree | 458098b55a29bd29c5b36ca8b8ab12871014eafd | |
| parent | 6b5e6bba9b0eb9c8e42fa16899c7bc738a51c5b0 [diff] |
Fix two problems in the ExecuteBinary function. - If the process exits abnormally then we will leak the stdout and stderr FDs. Fix it by closing the FDs before returning. - If another child process exits then we will incorrectly return the result from that process instead of waiting for our child. Fix it by using waitpid instead of wait. Change-Id: I8974d5e4bd33f264cd2d364f55a60f1f5cb7eb1a