libfortran/90038 Reap dead children when wait=.false.
authorJanne Blomqvist <jb@gcc.gnu.org>
Sun, 19 May 2019 19:38:11 +0000 (22:38 +0300)
committerJanne Blomqvist <jb@gcc.gnu.org>
Sun, 19 May 2019 19:38:11 +0000 (22:38 +0300)
commitef536b413e077a87b15a11e60ca4c2675d11dccb
treea13eae10848d4fb1f477e179eefb5f27f860344a
parentdbd5df2eb893bf5370fa3fdde6e09f21d4b26b79
libfortran/90038 Reap dead children when wait=.false.

When using posix_spawn or fork to launch a child process, the parent
needs to wait for the child, otherwise the dead child is left as a
zombie process. For this purpose one can install a signal handler for
SIGCHLD.

2019-05-19  Janne Blomqvist  <jb@gcc.gnu.org>

PR libfortran/90038
* intrinsics/execute_command_line (sigchld_handler): New function.
        (execute_command_line): Install handler for SIGCHLD.
        * configure.ac: Check for presence of sigaction and waitpid.
        * config.h.in: Regenerated.
        * configure: Regenerated.

Regtested on x86_64-pc-linux-gnu.

From-SVN: r271384
libgfortran/ChangeLog
libgfortran/config.h.in
libgfortran/configure
libgfortran/configure.ac
libgfortran/intrinsics/execute_command_line.c