summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive_write.3
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2004-11-05 05:26:30 +0000
committerkientzle <kientzle@FreeBSD.org>2004-11-05 05:26:30 +0000
commitfef2e8cee8e209e7511da1d45f988dd029197358 (patch)
treebbc8fe472af0e8dbd66e73826de4bcb674aab1ff /lib/libarchive/archive_write.3
parent0a60201e3c56d5679ba25dbcc969368ba3fb74ea (diff)
downloadFreeBSD-src-fef2e8cee8e209e7511da1d45f988dd029197358.zip
FreeBSD-src-fef2e8cee8e209e7511da1d45f988dd029197358.tar.gz
Clean up the error handling in the
write path. In particular, this should solve some problems people have seen with bsdtar not exiting on various write errors.
Diffstat (limited to 'lib/libarchive/archive_write.3')
-rw-r--r--lib/libarchive/archive_write.314
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/libarchive/archive_write.3 b/lib/libarchive/archive_write.3
index b7af9d5..cea0700 100644
--- a/lib/libarchive/archive_write.3
+++ b/lib/libarchive/archive_write.3
@@ -190,6 +190,7 @@ Build and write a header using the data in the provided
structure.
.It Fn archive_write_data
Write data corresponding to the header just written.
+Returns number of bytes written or -1 on error.
.It Fn archive_write_close
Complete the archive and invoke the close callback.
.It Fn archive_write_finish
@@ -321,20 +322,19 @@ and
.Fn archive_error_string
functions will return appropriate values.
Note that if the client-provided write callback function
-returns -1, that error will be propagated back to the caller
+returns a non-zero value, that error will be propagated back to the caller
through whatever API function resulted in that call, which
may include
.Fn archive_write_header ,
.Fn archive_write_data ,
or
.Fn archive_write_close .
-In such a case, the
+The client callback can call
+.Fn archive_set_error
+to provide values that can then be retrieved by
.Fn archive_errno
-or
-.Fn archive_error_string
-fields will not return useful information; you should use
-client-private data to return error information
-back to your mainline code.
+and
+.Fn archive_error_string .
.Sh SEE ALSO
.Xr tar 1 ,
.Xr libarchive 3 ,
OpenPOWER on IntegriCloud