(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.
#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
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. */