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
main
Igor Canadi 11 years ago
parent e51f55d7ae
commit 07e8078b17
  1. 4
      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);

Loading…
Cancel
Save