summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2007-04-15 01:01:20 +0000
committerkientzle <kientzle@FreeBSD.org>2007-04-15 01:01:20 +0000
commit5b9b31cc4237f558f84a99e26c931d7fe108a07b (patch)
tree1f3094af1481e8e354ece016b63bd621e556cf19 /lib
parentcc44f89006ca6ae738f04f8efb58efbbd52a7268 (diff)
downloadFreeBSD-src-5b9b31cc4237f558f84a99e26c931d7fe108a07b.zip
FreeBSD-src-5b9b31cc4237f558f84a99e26c931d7fe108a07b.tar.gz
Thanks to Colin for catching my mixup. The original problem wasn't
suppressing the second error, it was failing to address the first.
Diffstat (limited to 'lib')
-rw-r--r--lib/libarchive/archive_read_extract.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/libarchive/archive_read_extract.c b/lib/libarchive/archive_read_extract.c
index 2f0ba22..8828ec6 100644
--- a/lib/libarchive/archive_read_extract.c
+++ b/lib/libarchive/archive_read_extract.c
@@ -95,12 +95,17 @@ archive_read_extract(struct archive *_a, struct archive_entry *entry, int flags)
archive_write_disk_set_skip_file(a->extract->ad,
a->skip_file_dev, a->skip_file_ino);
r = archive_write_header(a->extract->ad, entry);
- if (r == ARCHIVE_OK)
- /* If there's an FD, pour data into it. */
+ if (r != ARCHIVE_OK)
+ /* If _write_header failed, copy the error. */
+ archive_set_error(&a->archive,
+ archive_errno(extract->ad),
+ "%s", archive_error_string(extract->ad));
+ else
+ /* Otherwise, pour data into the entry. */
r = copy_data(_a, a->extract->ad);
r2 = archive_write_finish_entry(a->extract->ad);
/* Use the first message. */
- if (r2 != ARCHIVE_OK || r != ARCHIVE_OK)
+ if (r2 != ARCHIVE_OK && r == ARCHIVE_OK)
archive_set_error(&a->archive,
archive_errno(extract->ad),
"%s", archive_error_string(extract->ad));
OpenPOWER on IntegriCloud