[commit: packages/process] master: Wait on child PID after pre-exec failure in child. (77dc6dc)
git at git.haskell.org
git at git.haskell.org
Thu Mar 19 11:37:27 UTC 2015
Repository : ssh://git@git.haskell.org/process
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/77dc6dc7142eb13104e2fbcc4d1ff706a48488d4/process
>---------------------------------------------------------------
commit 77dc6dc7142eb13104e2fbcc4d1ff706a48488d4
Author: David Turner <dave.c.turner at gmail.com>
Date: Fri Jan 9 14:15:12 2015 +0000
Wait on child PID after pre-exec failure in child.
>---------------------------------------------------------------
77dc6dc7142eb13104e2fbcc4d1ff706a48488d4
cbits/runProcess.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/cbits/runProcess.c b/cbits/runProcess.c
index 90bc2c9..e6d7c77 100644
--- a/cbits/runProcess.c
+++ b/cbits/runProcess.c
@@ -288,6 +288,11 @@ runInteractiveProcess (char *const args[],
// get the errno of whatever else went wrong instead.
errno = err;
}
+
+ // We forked the child, but the child had a problem and stopped so it's
+ // our responsibility to reap here as nobody else can.
+ waitpid(pid, NULL, 0);
+
pid = -1;
}
else if (r != 0) {
More information about the ghc-commits
mailing list