summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive_read_data_into_fd.c
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2004-06-27 01:15:31 +0000
committerkientzle <kientzle@FreeBSD.org>2004-06-27 01:15:31 +0000
commitfc2f6ee069a5f363320dec62ccf54b12ece0d438 (patch)
treed31c911cb53635ed8be6eeea16ab388e7e4a8941 /lib/libarchive/archive_read_data_into_fd.c
parent4731df16a26e51f2f571e0222cbf4aa767d23583 (diff)
downloadFreeBSD-src-fc2f6ee069a5f363320dec62ccf54b12ece0d438.zip
FreeBSD-src-fc2f6ee069a5f363320dec62ccf54b12ece0d438.tar.gz
Read gtar-style sparse archives.
This change also pointed out one API deficiency: the archive_read_data_into_XXX functions were originally defined to return the total bytes read. This is, of course, ambiguous when dealing with non-contiguous files. Change it to just return a status value.
Diffstat (limited to 'lib/libarchive/archive_read_data_into_fd.c')
-rw-r--r--lib/libarchive/archive_read_data_into_fd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libarchive/archive_read_data_into_fd.c b/lib/libarchive/archive_read_data_into_fd.c
index 85ba98d..b2143ca 100644
--- a/lib/libarchive/archive_read_data_into_fd.c
+++ b/lib/libarchive/archive_read_data_into_fd.c
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
/*
* This implementation minimizes copying of data and is sparse-file aware.
*/
-ssize_t
+int
archive_read_data_into_fd(struct archive *a, int fd)
{
int r;
@@ -76,6 +76,6 @@ archive_read_data_into_fd(struct archive *a, int fd)
}
if (r != ARCHIVE_EOF)
- return (-1);
- return (total_written);
+ return (r);
+ return (ARCHIVE_OK);
}
OpenPOWER on IntegriCloud