diff options
| author | Tim Kientzle <kientzle@FreeBSD.org> | 2008-08-10 02:19:17 +0000 |
|---|---|---|
| committer | Tim Kientzle <kientzle@FreeBSD.org> | 2008-08-10 02:19:17 +0000 |
| commit | 13908cf8c884da3c83a6c433f2cceb79db0a16ca (patch) | |
| tree | 5bcd7ee10795c2fbff8f67f6bd63137ac0a9fc9c /lib/libarchive | |
| parent | 49e55445655344a0dcb927e320ecc2167b7da1b3 (diff) | |
Notes
Diffstat (limited to 'lib/libarchive')
| -rw-r--r-- | lib/libarchive/archive_read_data_into_fd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/libarchive/archive_read_data_into_fd.c b/lib/libarchive/archive_read_data_into_fd.c index cc15a9c76c3c..b2421bbc827d 100644 --- a/lib/libarchive/archive_read_data_into_fd.c +++ b/lib/libarchive/archive_read_data_into_fd.c @@ -64,8 +64,12 @@ archive_read_data_into_fd(struct archive *a, int fd) ARCHIVE_OK) { const char *p = buff; if (offset > output_offset) { - lseek(fd, offset - output_offset, SEEK_CUR); - output_offset = offset; + output_offset = lseek(fd, + offset - output_offset, SEEK_CUR); + if (output_offset != offset) { + archive_set_error(a, errno, "Seek error"); + return (ARCHIVE_FATAL); + } } while (size > 0) { bytes_to_write = size; @@ -74,7 +78,7 @@ archive_read_data_into_fd(struct archive *a, int fd) bytes_written = write(fd, p, bytes_to_write); if (bytes_written < 0) { archive_set_error(a, errno, "Write error"); - return (-1); + return (ARCHIVE_FATAL); } output_offset += bytes_written; total_written += bytes_written; |
