diff options
author | kientzle <kientzle@FreeBSD.org> | 2007-05-29 01:00:21 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2007-05-29 01:00:21 +0000 |
commit | 013be331bc10706807599a452a143f4744398e9f (patch) | |
tree | 793787ab8615d768ba51341dfd934a5fb3039728 /lib/libarchive/archive_write.c | |
parent | c611006e893ac2bf962cabe02743954e3b3c3314 (diff) | |
download | FreeBSD-src-013be331bc10706807599a452a143f4744398e9f.zip FreeBSD-src-013be331bc10706807599a452a143f4744398e9f.tar.gz |
libarchive 2.2.3
* "compression_program" support uses an external program
* Portability: no longer uses "struct stat" as a primary
data interchange structure internally
* Part of the above: refactor archive_entry to separate
out copy_stat() and stat() functions
* More complete tests for archive_entry
* Finish archive_entry_clone()
* Isolate major()/minor()/makedev() in archive_entry; remove
these from everywhere else.
* Bug fix: properly handle decompression look-ahead at end-of-data
* Bug fixes to 'ar' support
* Fix memory leak in ZIP reader
* Portability: better timegm() emulation in iso9660 reader
* New write_disk flags to suppress auto dir creation and not
overwrite newer files (for future cpio front-end)
* Simplify trailing-'/' fixup when writing tar and pax
* Test enhancements: fix various compiler warnings, improve
portability, add lots of new tests.
* Documentation: document new functions, first draft of
libarchive_internals.3
MFC after: 14 days
Thanks to: Joerg Sonnenberger (compression_program)
Thanks to: Kai Wang (ar)
Thanks to: Colin Percival (many small fixes)
Thanks to: Many others who sent me various patches and problem reports.
Diffstat (limited to 'lib/libarchive/archive_write.c')
-rw-r--r-- | lib/libarchive/archive_write.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/libarchive/archive_write.c b/lib/libarchive/archive_write.c index ee1a9db..c9d40b0 100644 --- a/lib/libarchive/archive_write.c +++ b/lib/libarchive/archive_write.c @@ -99,7 +99,6 @@ archive_write_new(void) a->archive.vtable = archive_write_vtable(); a->bytes_per_block = ARCHIVE_DEFAULT_BYTES_PER_BLOCK; a->bytes_in_last_block = -1; /* Default */ - a->pformat_data = &(a->format_data); /* Initialize a block of nulls for padding purposes. */ a->null_length = 1024; @@ -208,7 +207,7 @@ archive_write_open(struct archive *_a, void *client_data, a->client_writer = writer; a->client_opener = opener; a->client_closer = closer; - ret = (a->compression_init)(a); + ret = (a->compressor.init)(a); if (a->format_init && ret == ARCHIVE_OK) ret = (a->format_init)(a); return (ret); @@ -242,7 +241,7 @@ _archive_write_close(struct archive *_a) r = r1; } - /* Release resources. */ + /* Release format resources. */ if (a->format_destroy != NULL) { r1 = (a->format_destroy)(a); if (r1 < r) @@ -250,8 +249,15 @@ _archive_write_close(struct archive *_a) } /* Finish the compression and close the stream. */ - if (a->compression_finish != NULL) { - r1 = (a->compression_finish)(a); + if (a->compressor.finish != NULL) { + r1 = (a->compressor.finish)(a); + if (r1 < r) + r = r1; + } + + /* Close out the client stream. */ + if (a->client_closer != NULL) { + r1 = (a->client_closer)(&a->archive, a->client_data); if (r1 < r) r = r1; } |