From: Tim Kientzle Date: Sat, 12 Nov 2011 20:46:05 +0000 (-0500) Subject: Merge r3744 from trunk: Correctly return errors when reading X-Git-Tag: v3.0.4~2^2~169^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d11e281e4b9a20e74eb3e3cf9f34c5dd807c221;p=thirdparty%2Flibarchive.git Merge r3744 from trunk: Correctly return errors when reading an archive using @archive extension. SVN-Revision: 3769 --- diff --git a/tar/write.c b/tar/write.c index 32ee2b6d8..6aeb47c45 100644 --- a/tar/write.c +++ b/tar/write.c @@ -592,7 +592,7 @@ append_archive(struct bsdtar *bsdtar, struct archive *a, struct archive *ina) struct archive_entry *in_entry; int e; - while (0 == archive_read_next_header(ina, &in_entry)) { + while (ARCHIVE_OK == (e = archive_read_next_header(ina, &in_entry))) { if (!new_enough(bsdtar, archive_entry_pathname(in_entry), archive_entry_stat(in_entry))) continue; @@ -630,8 +630,7 @@ append_archive(struct bsdtar *bsdtar, struct archive *a, struct archive *ina) fprintf(stderr, "\n"); } - /* Note: If we got here, we saw no write errors, so return success. */ - return (0); + return (e == ARCHIVE_EOF ? ARCHIVE_OK : e); } /* Helper function to copy data between archives. */