aboutsummaryrefslogtreecommitdiff
path: root/lib/libarchive
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@FreeBSD.org>2007-04-15 01:01:20 +0000
committerTim Kientzle <kientzle@FreeBSD.org>2007-04-15 01:01:20 +0000
commitedddd6089933bbc5f5829dfe8b2309ad00e69cc4 (patch)
tree1f3094af1481e8e354ece016b63bd621e556cf19 /lib/libarchive
parentf912fb118f77b055f9ed02ca031b13b14f5e1111 (diff)
Notes
Diffstat (limited to 'lib/libarchive')
-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 2f0ba229253e..8828ec6a801d 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));