From: Carl Worth Date: Wed, 29 Jul 2009 23:10:01 +0000 (-0700) Subject: Don't close file stream before EOF, closes #525818 X-Git-Url: https://git.cworth.org/git?p=tar;a=commitdiff_plain;h=a39751e44721377bf30522e2fe278051daa3cee1 Don't close file stream before EOF, closes #525818 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. --- diff --git a/debian/changelog b/debian/changelog index 4cd8456..df3a125 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Wed, 29 Jul 2009 14:04:18 -0700 + -- Carl Worth Wed, 29 Jul 2009 16:18:18 -0700 tar (1.22-1.1) unstable; urgency=low diff --git a/src/list.c b/src/list.c index c650172..126a3c1 100644 --- a/src/list.c +++ b/src/list.c @@ -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