aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@FreeBSD.org>2005-03-13 01:52:35 +0000
committerTim Kientzle <kientzle@FreeBSD.org>2005-03-13 01:52:35 +0000
commit569ed75cbcf8f2b08d9b141dc80e79d9379533ce (patch)
tree584d4179b35284ca483e5529561275113607c472
parent20b8c5892032e4ab8934e5496cff01ee5106aebe (diff)
downloadsrc-569ed75cbcf8f2b08d9b141dc80e79d9379533ce.tar.gz
src-569ed75cbcf8f2b08d9b141dc80e79d9379533ce.zip
Correctly pass low-level I/O errors back up to the caller when
reading cpio format.
Notes
Notes: svn path=/head/; revision=143480
-rw-r--r--lib/libarchive/archive_read_support_format_cpio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libarchive/archive_read_support_format_cpio.c b/lib/libarchive/archive_read_support_format_cpio.c
index b795337221d9..4a8d61a4a0fa 100644
--- a/lib/libarchive/archive_read_support_format_cpio.c
+++ b/lib/libarchive/archive_read_support_format_cpio.c
@@ -161,8 +161,11 @@ archive_read_format_cpio_bid(struct archive *a)
cpio = *(a->pformat_data);
bid = 0;
bytes_read = (a->compression_read_ahead)(a, &h, 6);
+ /* Convert error code into error return. */
+ if (bytes_read < 0)
+ return ((int)bytes_read);
if (bytes_read < 6)
- return (-1);
+ return (-1);
p = h;
if (memcmp(p, "070707", 6) == 0) {