summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive_write_set_compression_gzip.c
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2009-03-03 17:07:27 +0000
committerkientzle <kientzle@FreeBSD.org>2009-03-03 17:07:27 +0000
commit6e238f0b3b5bbe212f299efcd3f714a5fc7fda6b (patch)
tree0886cf5daac41080c59dd4928120d572bbb74f28 /lib/libarchive/archive_write_set_compression_gzip.c
parent8fc5e74eab7c5235eef741a5e99412c1c314b9c6 (diff)
downloadFreeBSD-src-6e238f0b3b5bbe212f299efcd3f714a5fc7fda6b.zip
FreeBSD-src-6e238f0b3b5bbe212f299efcd3f714a5fc7fda6b.tar.gz
Merge r340 from libarchive.googlecode.com: If zlib/bzlib aren't available,
we can still detect gzip/bzip2 compressed streams, we just can't decompress them.
Diffstat (limited to 'lib/libarchive/archive_write_set_compression_gzip.c')
-rw-r--r--lib/libarchive/archive_write_set_compression_gzip.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/libarchive/archive_write_set_compression_gzip.c b/lib/libarchive/archive_write_set_compression_gzip.c
index e4db651..807d54e 100644
--- a/lib/libarchive/archive_write_set_compression_gzip.c
+++ b/lib/libarchive/archive_write_set_compression_gzip.c
@@ -25,9 +25,6 @@
#include "archive_platform.h"
-/* Don't compile this if we don't have zlib. */
-#if HAVE_ZLIB_H
-
__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
@@ -48,6 +45,16 @@ __FBSDID("$FreeBSD$");
#include "archive_private.h"
#include "archive_write_private.h"
+#ifndef HAVE_ZLIB_H
+int
+archive_write_set_compression_gzip(struct archive *_a)
+{
+ /* Unsupported gzip compression, we don't have zlib */
+ return (ARCHIVE_FATAL);
+}
+#else
+/* Don't compile this if we don't have zlib. */
+
struct private_data {
z_stream stream;
int64_t total_in;
OpenPOWER on IntegriCloud