]> Dogcows Code - chaz/tar/commitdiff
Include signal.h.
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 3 Jul 1999 00:00:19 +0000 (00:00 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 3 Jul 1999 00:00:19 +0000 (00:00 +0000)
(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.

src/tar.c

index 9b73de3cce8c23b9570356fd95a481de9b4fa88d..4d3ec0e26f937d23084dc2ae0957a2901a628f70 100644 (file)
--- a/src/tar.c
+++ b/src/tar.c
 
 #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.  */
This page took 0.02537 seconds and 4 git commands to generate.