summaryrefslogtreecommitdiff
path: root/lib/libarchive/archive_write.c
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@FreeBSD.org>2004-12-22 00:01:55 +0000
committerTim Kientzle <kientzle@FreeBSD.org>2004-12-22 00:01:55 +0000
commit4cf45adfa9536430c1dbb77fcc1e933010bfb03e (patch)
tree575c539166fa96040c72feb8f731e1d258a20c7b /lib/libarchive/archive_write.c
parentc0bf0bec22bf23b4ca952af5fe9abead133ea961 (diff)
Notes
Diffstat (limited to 'lib/libarchive/archive_write.c')
-rw-r--r--lib/libarchive/archive_write.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libarchive/archive_write.c b/lib/libarchive/archive_write.c
index 40f660d05c53..76b42884cda7 100644
--- a/lib/libarchive/archive_write.c
+++ b/lib/libarchive/archive_write.c
@@ -215,9 +215,12 @@ archive_write_header(struct archive *a, struct archive_entry *entry)
/*
* Note that the compressor is responsible for blocking.
*/
+/* Should be "ssize_t", but that breaks the ABI. <sigh> */
int
archive_write_data(struct archive *a, const void *buff, size_t s)
{
+ int ret;
archive_check_magic(a, ARCHIVE_WRITE_MAGIC, ARCHIVE_STATE_DATA);
- return (a->format_write_data(a, buff, s));
+ ret = (a->format_write_data)(a, buff, s);
+ return (ret == ARCHIVE_OK ? (ssize_t)s : -1);
}