diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-10-12 18:52:09 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-10-12 18:52:09 +0300 |
commit | 5f2769a03542c039720b98525477495acaa51a06 (patch) | |
tree | d91450efd729e3804095945631b37221d7500e08 /src | |
parent | 055f49e2c626027c6a1641d7cd4b9c66aebbe403 (diff) | |
download | pies-5f2769a03542c039720b98525477495acaa51a06.tar.gz pies-5f2769a03542c039720b98525477495acaa51a06.tar.bz2 |
Make sure exited preprocessor gets cleaned up when running with PID 1.
* NEWS: Version 1.4.90
* configure.ac: Version 1.4.90
* src/pies.c (main): When running with PID 1, install a minimal
SIGCHLD handler before parsing configuration files.
Diffstat (limited to 'src')
-rw-r--r-- | src/pies.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -1885,6 +1885,13 @@ sig_handler (int sig) } } +RETSIGTYPE +sigchld_early (int sig) +{ + while (waitpid (-1, NULL, WNOHANG) != -1) + ; +} + void setsigvhan (RETSIGTYPE (*handler) (int signo), int *sigv, int sigc) { @@ -2284,6 +2291,12 @@ main (int argc, char **argv) set_quoting_style (NULL, shell_quoting_style); init_process = getpid () == 1; + if (init_process) + { + int s[] = { SIGCHLD }; + setsigvhan (sigchld_early, s, 1); + } + for (i = 1; i < argc; i++) { if (strcmp (argv[i], "--no-init") == 0) |