X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Ftar.c;h=32e8522f8d3c0c1b9a62bb98abe9ed171a9844a3;hb=07f380748c431d6f4e1f1d668792e9dd1fb3fc7f;hp=9b73de3cce8c23b9570356fd95a481de9b4fa88d;hpb=6f1783ad432c0d2625d1232463987594414089fe;p=chaz%2Ftar diff --git a/src/tar.c b/src/tar.c index 9b73de3..32e8522 100644 --- a/src/tar.c +++ b/src/tar.c @@ -20,6 +20,11 @@ #include +#include +#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 @@ -447,6 +452,7 @@ decode_options (int argc, char *const *argv) archive_format = DEFAULT_FORMAT; blocking_factor = DEFAULT_BLOCKING; record_size = DEFAULT_BLOCKING * BLOCKSIZE; + excluded = new_exclude (); owner_option = -1; group_option = -1; @@ -778,8 +784,8 @@ decode_options (int argc, char *const *argv) break; case 'X': - exclude_option = 1; - add_exclude_file (optarg); + if (add_exclude_file (excluded, optarg, '\n') != 0) + FATAL_ERROR ((0, errno, "%s", optarg)); break; case 'z': @@ -805,8 +811,7 @@ decode_options (int argc, char *const *argv) break; case EXCLUDE_OPTION: - exclude_option = 1; - add_exclude (optarg); + add_exclude (excluded, optarg); break; case GROUP_OPTION: @@ -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. */