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_write_set_compression_gzip.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_write_set_compression_gzip.c')
-rw-r--r-- | lib/libarchive/archive_write_set_compression_gzip.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/libarchive/archive_write_set_compression_gzip.c b/lib/libarchive/archive_write_set_compression_gzip.c index 7c9ade6..cd44e8e 100644 --- a/lib/libarchive/archive_write_set_compression_gzip.c +++ b/lib/libarchive/archive_write_set_compression_gzip.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 <errno.h> @@ -149,7 +149,7 @@ archive_compressor_gzip_init(struct archive *a) } /* Library setup failed: clean up. */ - archive_set_error(a, -1, "Internal error " + archive_set_error(a, ARCHIVE_ERRNO_MISC, "Internal error " "initializing compression library"); free(state->compressed); free(state); @@ -157,7 +157,8 @@ archive_compressor_gzip_init(struct archive *a) /* Override the error message if we know what really went wrong. */ switch (ret) { case Z_STREAM_ERROR: - archive_set_error(a, EINVAL, "Internal error initializing " + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Internal error initializing " "compression library: invalid setup parameter"); break; case Z_MEM_ERROR: @@ -165,7 +166,8 @@ archive_compressor_gzip_init(struct archive *a) "compression library"); break; case Z_VERSION_ERROR: - archive_set_error(a, -1, "Internal error initializing " + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Internal error initializing " "compression library: invalid library version"); break; } @@ -185,7 +187,7 @@ archive_compressor_gzip_write(struct archive *a, const void *buff, state = a->compression_data; if (!a->client_writer) { - archive_set_error(a, EDOOFUS, + archive_set_error(a, ARCHIVE_ERRNO_PROGRAMMER, "No write callback is registered? " "This is probably an internal programming error."); return (ARCHIVE_FATAL); @@ -220,7 +222,7 @@ archive_compressor_gzip_finish(struct archive *a) state = a->compression_data; ret = 0; if (a->client_writer == NULL) { - archive_set_error(a, EDOOFUS, + archive_set_error(a, ARCHIVE_ERRNO_PROGRAMMER, "No write callback is registered? " "This is probably an internal programming error."); ret = ARCHIVE_FATAL; @@ -310,7 +312,8 @@ cleanup: case Z_OK: break; default: - archive_set_error(a, -1, "Failed to clean up compressor"); + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Failed to clean up compressor"); ret = ARCHIVE_FATAL; } free(state->compressed); @@ -373,7 +376,8 @@ drive_compressor(struct archive *a, struct private_data *state, int finishing) return (ARCHIVE_OK); default: /* Any other return value indicates an error. */ - archive_set_error(a, -1, "GZip compression failed"); + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "GZip compression failed"); return (ARCHIVE_FATAL); } } |