]> git.cworth.org Git - gzip/commitdiff
Imported Debian patch 1.3.5-12
authorBdale Garbee <bdale@gag.com>
Mon, 11 Jul 2005 19:10:51 +0000 (22:10 +0300)
committerBdale Garbee <bdale@gag.com>
Fri, 6 Jun 2008 04:29:30 +0000 (22:29 -0600)
debian/changelog
debian/control
gzip.1
gzip.c
gzip.h

index 088bed8e727e7e9eb4539ba7f1b15d6de7c307c6..4ae5ebea8db868ee02c70f6a61c3e9f248352072 100644 (file)
@@ -1,3 +1,12 @@
+gzip (1.3.5-12) unstable; urgency=low
+
+  * merge patch from Matt Zimmerman for futex hang due to improper signal
+    handling, closes: #310053, #315612
+  * merge patch to add --rsyncable to the man page, closes: #289616, #295721
+  * don't return failing result code on harmless warning, closes: #169669
+
+ -- Bdale Garbee <bdale@gag.com>  Mon, 11 Jul 2005 22:10:51 +0300
+
 gzip (1.3.5-11) unstable; urgency=low
 
   * patch from Peter Samuelson for bashism in zgrep, 
index 9b8ccd12a659c176b695fe72026842ee38099c37..fc588f626f50659f153836a324c43e2e4ce95c9b 100644 (file)
@@ -3,7 +3,7 @@ Section: base
 Priority: required
 Maintainer: Bdale Garbee <bdale@gag.com>
 Build-Depends: debhelper (>= 3), texinfo
-Standards-Version: 3.6.1.0
+Standards-Version: 3.6.2.1
 
 Package: gzip
 Architecture: any
diff --git a/gzip.1 b/gzip.1
index f5d03ff3ef59b6fa5ba6aa952f8d61d28509c3ab..4457856137ed1d63779aa780bac09f53839ce9d3 100644 (file)
--- a/gzip.1
+++ b/gzip.1
@@ -290,6 +290,15 @@ will descend into the directory and compress all the files it finds there
 .I gunzip
 ).
 .TP
+.B --rsyncable
+While compressing, synchronize the output occasionally based on the input.
+This increases size by less than 1 percent most cases, but means that the
+.BR rsync (1)
+program can much more efficiently syncronize files compressed with this flag.
+.I gunzip
+cannot tell the difference between a compressed file created with this option,
+and one created without it.
+.TP
 .B \-S .suf   --suffix .suf
 Use suffix .suf instead of .gz. Any suffix can be given, but suffixes
 other than .z and .gz should be avoided to avoid confusion when files
diff --git a/gzip.c b/gzip.c
index 61f721e6ed725d3375e88755e3522d607f1f84fe..a72cb201b0a4831ce11827c2b35c04f5b2b8d21d 100644 (file)
--- a/gzip.c
+++ b/gzip.c
@@ -467,16 +467,16 @@ int main (argc, argv)
 
     foreground = signal(SIGINT, SIG_IGN) != SIG_IGN;
     if (foreground) {
-       (void) signal (SIGINT, (sig_type)abort_gzip);
+       (void) signal (SIGINT, (sig_type)abort_gzip_signal);
     }
 #ifdef SIGTERM
     if (signal(SIGTERM, SIG_IGN) != SIG_IGN) {
-       (void) signal(SIGTERM, (sig_type)abort_gzip);
+       (void) signal(SIGTERM, (sig_type)abort_gzip_signal);
     }
 #endif
 #ifdef SIGHUP
     if (signal(SIGHUP, SIG_IGN) != SIG_IGN) {
-       (void) signal(SIGHUP,  (sig_type)abort_gzip);
+       (void) signal(SIGHUP,  (sig_type)abort_gzip_signal);
     }
 #endif
 
@@ -586,7 +586,7 @@ int main (argc, argv)
 #ifdef SIGPIPE
     /* Ignore "Broken Pipe" message with --quiet */
     if (quiet && signal (SIGPIPE, SIG_IGN) != SIG_IGN)
-      signal (SIGPIPE, (sig_type) abort_gzip);
+      signal (SIGPIPE, (sig_type) abort_gzip_signal);
 #endif
 
     /* By default, save name and timestamp on compression but do not
@@ -1169,8 +1169,9 @@ local int make_ofname()
     } else if (suff != NULL) {
        /* Avoid annoying messages with -r (see treat_dir()) */
        if (verbose || (!recursive && !quiet)) {
-           WARN((stderr, "%s: %s already has %s suffix -- unchanged\n",
-                 progname, ifname, suff));
+           /* don't use WARN -- it will cause an exit_code of 2 */
+           fprintf(stderr, "%s: %s already has %s suffix -- unchanged\n",
+                 progname, ifname, suff);
        }
        return WARNING;
     } else {
@@ -1850,13 +1851,31 @@ local void do_exit(exitcode)
 }
 
 /* ========================================================================
- * Signal and error handler.
+ * Close and unlink the output file if appropriate.  This routine must be
+ * async-signal-safe.
  */
-RETSIGTYPE abort_gzip()
-{
+local void do_remove() {
    if (remove_ofname) {
        close(ofd);
        xunlink (ofname);
    }
-   do_exit(ERROR);
 }
+
+/* ========================================================================
+ * Error handler.
+ */
+RETSIGTYPE abort_gzip()
+{
+       do_remove();
+       do_exit(ERROR);
+}
+
+/* ========================================================================
+ * Signal handler.
+ */
+RETSIGTYPE abort_gzip_signal()
+{
+       do_remove();
+       _exit(ERROR);
+}
+
diff --git a/gzip.h b/gzip.h
index 3629a55164eeef4f0e4b11ed5704cf02fef75801..e3cc75c355fe41a577435f8211d08e6517dd4481 100644 (file)
--- a/gzip.h
+++ b/gzip.h
@@ -273,7 +273,7 @@ extern int unpack     OF((int in, int out));
 extern int unlzh      OF((int in, int out));
 
        /* in gzip.c */
-RETSIGTYPE abort_gzip OF((void));
+RETSIGTYPE abort_gzip_signal OF((void));
 
         /* in deflate.c */
 void lm_init OF((int pack_level, ush *flags));