Attention: Tentative fix only! But at least this works much better
than before.
From the Linux man page for waitpid:
[...]
ERRORS
ECHILD if the process specified in pid does not exist or
is not a child of the calling process. (This can
happen for one's own child if the action for
SIGCHLD is set to SIG_IGN. See also the LINUX NOTES
section about threads.)
[...]
Consequently, we don't ignore SIGCHLD anymore. Further changes:
* SIGCONT is not ignored anymore, either. What was this for?
* Don't use WUNTRACED in waitpid. Again, what was this for?
= traceCmd phase_name (concat (intersperse " " (pgm:quoteargs))) $
do
#ifndef mingw32_HOST_OS
- installHandler sigCHLD Ignore Nothing
- -- avoid strange interaction with waitpid():
- installHandler sigCONT Ignore Nothing
mpid <- forkProcess
exit_code <- case mpid of
Nothing -> do -- Child
-- NOT REACHED
return ExitSuccess
Just child -> do -- Parent
- Just (Exited res) <- getProcessStatus True True child
+ Just (Exited res) <- getProcessStatus True False child
return res
#else
exit_code <- rawSystem cmd_line