From 07e8078b17474c9fc9cf10affbb10e88d5f7b7a4 Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Mon, 18 Nov 2013 20:33:34 -0800 Subject: [PATCH] Fix BZip constants Summary: We were using ZLIB constants in BZIP code path. This caused some errors, like: https://github.com/facebook/rocksdb/issues/8 Test Plan: make clean; make check Reviewers: dhruba, kailiu Reviewed By: dhruba CC: leveldb Differential Revision: https://reviews.facebook.net/D14175 --- port/port_posix.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/port/port_posix.h b/port/port_posix.h index 84d91e8de..15ab0dc5b 100644 --- a/port/port_posix.h +++ b/port/port_posix.h @@ -339,7 +339,7 @@ inline bool BZip2_Compress(const CompressionOptions& opts, const char* input, _stream.next_out = (char *)&(*output)[old_sz]; _stream.avail_out = new_sz - old_sz; break; - case Z_BUF_ERROR: + case BZ_SEQUENCE_ERROR: default: BZ2_bzCompressEnd(&_stream); return false; @@ -383,7 +383,7 @@ inline char* BZip2_Uncompress(const char* input_data, size_t input_length, switch (st) { case BZ_STREAM_END: break; - case Z_OK: + case BZ_OK: // No output space. Increase the output space by 20%. old_sz = output_len; output_len = (int)(output_len * 1.2);