diff options
author | kientzle <kientzle@FreeBSD.org> | 2005-03-13 01:52:35 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2005-03-13 01:52:35 +0000 |
commit | 816c5be74488c3c1969743eb6cf711ed170d9c96 (patch) | |
tree | 584d4179b35284ca483e5529561275113607c472 /lib | |
parent | 3d74129d7e1f125cb4b8893cff77845f536d78d2 (diff) | |
download | FreeBSD-src-816c5be74488c3c1969743eb6cf711ed170d9c96.zip FreeBSD-src-816c5be74488c3c1969743eb6cf711ed170d9c96.tar.gz |
Correctly pass low-level I/O errors back up to the caller when
reading cpio format.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libarchive/archive_read_support_format_cpio.c | 5 |
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 b795337..4a8d61a 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) { |