]> git.cworth.org Git - tar/commitdiff
Don't close file stream before EOF, closes #525818
authorCarl Worth <cworth@cworth.org>
Wed, 29 Jul 2009 23:10:01 +0000 (16:10 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 30 Jul 2009 00:33:26 +0000 (17:33 -0700)
To fix bug #235820 src/list.c was modified to avoid printing
a confusing warning message about a lone zero block. However,
the change also caused the input stream to be closed before
reading EOF which could cause a SIGPIPE to be sent to the
writing process.

In this change, the previous fix is made more narrow to exclude
only the printing of the warning message, but without the side
effect that was causing the SIGPIPE.

debian/changelog
src/list.c

index 4cd8456517fc83d07a77b489ade3e4fc715ee9de..df3a1253994ef3ad511e9476f48abdbb3715d01f 100644 (file)
@@ -2,8 +2,9 @@ tar (1.22-1.2) UNRELEASED; urgency=low
 
   * Add Carl Worth as an uploader.
   * Fix to allow parallel build (-j2), closes #535319
+  * Don't close file stream before EOF, closes #525818
 
- -- Carl Worth <cworth@cworth.org>  Wed, 29 Jul 2009 14:04:18 -0700
+ -- Carl Worth <cworth@cworth.org>  Wed, 29 Jul 2009 16:18:18 -0700
 
 tar (1.22-1.1) unstable; urgency=low
 
index c6501722ff4c0d8cbff54ee1db8b62daaf61729c..126a3c1fb8b2732a5fefe724bceb21e41fb3376b 100644 (file)
@@ -136,7 +136,11 @@ read_and (void (*do_something) (void))
 
          if (!ignore_zeros_option)
            {
+             char buf[UINTMAX_STRSIZE_BOUND];
 
+             status = read_header (false);
+             if (status == HEADER_ZERO_BLOCK)
+               break;
              /* 
               * According to POSIX tar specs, this is wrong, but on the web
               * there are some tar specs that can trigger this, and some tar
@@ -144,11 +148,6 @@ read_and (void (*do_something) (void))
               * let's not be pedantic about issuing the warning.
               */
 #if 0         
-             char buf[UINTMAX_STRSIZE_BOUND];
-
-             status = read_header (false);
-             if (status == HEADER_ZERO_BLOCK)
-               break;
              WARN ((0, 0, _("A lone zero block at %s"),
                     STRINGIFY_BIGINT (current_block_ordinal (), buf)));
 #endif