diff options
author | kientzle <kientzle@FreeBSD.org> | 2004-03-09 19:50:41 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2004-03-09 19:50:41 +0000 |
commit | 90072dfae070d180d3c16e0f229fb392b4b910b5 (patch) | |
tree | cdb30a1bca796a2ba7a0c712682c923cc981d32c /lib/libarchive/archive_read_support_compression_bzip2.c | |
parent | 63f793ca249823f0c3812457a8342dd6702d0548 (diff) | |
download | FreeBSD-src-90072dfae070d180d3c16e0f229fb392b4b910b5.zip FreeBSD-src-90072dfae070d180d3c16e0f229fb392b4b910b5.tar.gz |
Many fixes.
Portability: Thanks to Juergen Lock, libarchive now compiles cleanly
on Linux. Along the way, I cleaned up a lot of error return codes and
reorganized some code to simplify conditional compilation of certain
sections.
Bug fixes:
* pax format now actually stores filenames that are 101-154
characters long.
* pax format now allows newline characters in extended attributes
(this fixes a long-standing bug in ACL handling)
* mtime/atime are now restored for directories
* directory list is now sorted prior to fix-up to permit
correct restore of non-writable dir heirarchies
Diffstat (limited to 'lib/libarchive/archive_read_support_compression_bzip2.c')
-rw-r--r-- | lib/libarchive/archive_read_support_compression_bzip2.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/libarchive/archive_read_support_compression_bzip2.c b/lib/libarchive/archive_read_support_compression_bzip2.c index c97160f..85ae5a9 100644 --- a/lib/libarchive/archive_read_support_compression_bzip2.c +++ b/lib/libarchive/archive_read_support_compression_bzip2.c @@ -24,10 +24,10 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <sys/cdefs.h> +#include "archive_platform.h" __FBSDID("$FreeBSD$"); -#ifdef DMALLOC +#ifdef HAVE_DMALLOC #include <dmalloc.h> #endif #include <err.h> @@ -181,25 +181,25 @@ init(struct archive *a, const void *buff, size_t n) } /* Library setup failed: Clean up. */ - archive_set_error(a, -1, "Internal error initializing %s library", - a->compression_name); + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Internal error initializing %s library", a->compression_name); free(state->uncompressed_buffer); free(state); /* Override the error message if we know what really went wrong. */ switch (ret) { case BZ_PARAM_ERROR: - archive_set_error(a, -1, + archive_set_error(a, ARCHIVE_ERRNO_MISC, "Internal error initializing compression library: " "invalid setup parameter"); break; case BZ_MEM_ERROR: - archive_set_error(a, -1, + archive_set_error(a, ARCHIVE_ERRNO_MISC, "Internal error initializing compression library: " "out of memory"); break; case BZ_CONFIG_ERROR: - archive_set_error(a, -1, + archive_set_error(a, ARCHIVE_ERRNO_MISC, "Internal error initializing compression library: " "mis-compiled library"); break; @@ -221,7 +221,7 @@ read_ahead(struct archive *a, const void **p, size_t min) state = a->compression_data; was_avail = -1; if (!a->client_reader) { - archive_set_error(a, EINVAL, + archive_set_error(a, ARCHIVE_ERRNO_PROGRAMMER, "No read callback is registered? " "This is probably an internal programming error."); return (ARCHIVE_FATAL); @@ -284,8 +284,8 @@ finish(struct archive *a) case BZ_OK: break; default: - archive_set_error(a, -1, "Failed to clean up %s compressor", - a->compression_name); + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Failed to clean up %s compressor", a->compression_name); ret = ARCHIVE_FATAL; } @@ -323,7 +323,7 @@ drive_decompressor(struct archive *a, struct private_data *state) goto fatal; } if (ret == 0 && total_decompressed == 0) { - archive_set_error(a, -1, + archive_set_error(a, EIO, "Premature end of %s compressed data", a->compression_name); return (ARCHIVE_FATAL); @@ -359,7 +359,7 @@ drive_decompressor(struct archive *a, struct private_data *state) /* Return a fatal error. */ fatal: - archive_set_error(a, -1, "%s decompression failed", + archive_set_error(a, ARCHIVE_ERRNO_MISC, "%s decompression failed", a->compression_name); return (ARCHIVE_FATAL); } |