]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Merge r3744 from trunk: Correctly return errors when reading
authorTim Kientzle <kientzle@gmail.com>
Sat, 12 Nov 2011 20:46:05 +0000 (15:46 -0500)
committerTim Kientzle <kientzle@gmail.com>
Sat, 12 Nov 2011 20:46:05 +0000 (15:46 -0500)
an archive using @archive extension.

SVN-Revision: 3769

tar/write.c

index 32ee2b6d83bca1a7c917d048185ca7f554675471..6aeb47c455a6212333b7a502af728f1126c1be1c 100644 (file)
@@ -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. */