X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gzip.c;h=5fc6ded293c785ed584812e0b7eae73bcb0ecc9c;hb=01862fe8836ddda5a652180653abdaffa143f0c2;hp=35b36031f4f3f9739c442578f7e308e7894eed53;hpb=dc84183747ce1703eb99685b5dbde1f65a143c06;p=debian%2Fgzip diff --git a/gzip.c b/gzip.c index 35b3603..5fc6ded 100644 --- a/gzip.c +++ b/gzip.c @@ -213,6 +213,7 @@ int ofd; /* output file descriptor */ unsigned insize; /* valid bytes in inbuf */ unsigned inptr; /* index of next byte to be processed in inbuf */ unsigned outcnt; /* bytes in output buffer */ +int rsync = 0; /* make ryncable chunks */ static int handled_sig[] = { @@ -222,7 +223,9 @@ static int handled_sig[] = #ifdef SIGHUP , SIGHUP #endif +#ifdef SIGPIPE , SIGPIPE +#endif #ifdef SIGTERM , SIGTERM #endif @@ -270,7 +273,7 @@ static const struct option longopts[] = {"best", 0, 0, '9'}, /* compress better */ {"lzw", 0, 0, 'Z'}, /* make output compatible with old compress */ {"bits", 1, 0, 'b'}, /* max number of bits per code (implies -Z) */ - + {"rsyncable", 0, 0, 'R'}, /* make rsync-friendly archive */ { 0, 0, 0, 0 } }; @@ -353,6 +356,7 @@ local void help() " -Z, --lzw produce output compatible with old compress", " -b, --bits=BITS max number of bits per code (implies -Z)", #endif + " --rsyncable Make rsync-friendly archive", "", "With no FILE, or when FILE is -, read standard input.", "", @@ -481,8 +485,11 @@ int main (int argc, char **argv) #else recursive = 1; #endif - break; - case 'S': + break; + case 'R': + rsync = 1; break; + + case 'S': #ifdef NO_MULTIPLE_DOTS if (*optarg == '.') optarg++; #endif @@ -549,7 +556,11 @@ int main (int argc, char **argv) ALLOC(ush, tab_prefix1, 1L<<(BITS-1)); #endif +#ifdef SIGPIPE exiting_signal = quiet ? SIGPIPE : 0; +#else + exiting_signal = 0; +#endif install_signal_handlers (); /* And get to work */