mirror of
https://git.savannah.gnu.org/git/tar.git
synced 2026-05-31 12:06:46 +00:00
Include signal.h.
(SIGCHLD): Define to SIGCLD if SIGCLD is defined but SIGCHLD is not. (main): Ensure SIGCHLD is not ignored, so that we can fork and wait.
This commit is contained in:
10
src/tar.c
10
src/tar.c
@@ -20,6 +20,11 @@
|
||||
|
||||
#include <getopt.h>
|
||||
|
||||
#include <signal.h>
|
||||
#if ! defined SIGCHLD && defined SIGCLD
|
||||
# define SIGCHLD SIGCLD
|
||||
#endif
|
||||
|
||||
/* The following causes "common.h" to produce definitions of all the global
|
||||
variables, rather than just "extern" declarations of them. GNU tar does
|
||||
depend on the system loader to preset all GLOBAL variables to neutral (or
|
||||
@@ -1116,6 +1121,11 @@ main (int argc, char *const *argv)
|
||||
xmalloc (sizeof (const char *) * allocated_archive_names);
|
||||
archive_names = 0;
|
||||
|
||||
#ifdef SIGCHLD
|
||||
/* System V fork+wait does not work if SIGCHLD is ignored. */
|
||||
signal (SIGCHLD, SIG_DFL);
|
||||
#endif
|
||||
|
||||
init_names ();
|
||||
|
||||
/* Decode options. */
|
||||
|
||||
Reference in New Issue
Block a user