From: Sergey Poznyakoff Date: Sat, 14 Oct 2006 21:11:43 +0000 (+0000) Subject: Do not attempt to close stderr after call to close_stdout. X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=372638ae7abfba3175ef2d10d265da6fea0dc33f;p=chaz%2Ftar Do not attempt to close stderr after call to close_stdout. --- diff --git a/src/tar.c b/src/tar.c index 5b68548..e0b8ad0 100644 --- a/src/tar.c +++ b/src/tar.c @@ -2327,13 +2327,14 @@ main (int argc, char **argv) free (archive_name_array); name_term (); - if (stdlis == stdout) - close_stdout (); - if (exit_status == TAREXIT_FAILURE) error (0, 0, _("Error exit delayed from previous errors")); - if (ferror (stderr) || fclose (stderr) != 0) + + if (stdlis == stdout) + close_stdout (); + else if (ferror (stderr) || fclose (stderr) != 0) exit_status = TAREXIT_FAILURE; + return exit_status; }