summaryrefslogtreecommitdiffstats
path: root/usr.bin/tar
diff options
context:
space:
mode:
authormm <mm@FreeBSD.org>2011-12-20 20:36:00 +0000
committermm <mm@FreeBSD.org>2011-12-20 20:36:00 +0000
commitfbc163e4413f967184b1e4ac9d2228f8a95f06d3 (patch)
tree72b318ea979e482a16d6a8c88f0e1aa468c972dc /usr.bin/tar
parentf3adf4b52d600e699c5d826866cb5f4c520bb5a3 (diff)
downloadFreeBSD-src-fbc163e4413f967184b1e4ac9d2228f8a95f06d3.zip
FreeBSD-src-fbc163e4413f967184b1e4ac9d2228f8a95f06d3.tar.gz
Sync bsdtar with vendor branch release/2.8:
Revision 3769: Merge r3744 from trunk: Correctly return errors when reading an archive using @archive extension. Obtained from: http://code.google.com/p/libarchive MFC after: 2 weeks
Diffstat (limited to 'usr.bin/tar')
-rw-r--r--usr.bin/tar/write.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/tar/write.c b/usr.bin/tar/write.c
index a0a9b75..1105159 100644
--- a/usr.bin/tar/write.c
+++ b/usr.bin/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. */
OpenPOWER on IntegriCloud