diff --git a/port/port_posix.h b/port/port_posix.h index 8ff2480a3..839e89afe 100644 --- a/port/port_posix.h +++ b/port/port_posix.h @@ -349,7 +349,6 @@ inline bool BZip2_Compress(const CompressionOptions& opts, const char* input, output->resize(output->size() - _stream.avail_out); BZ2_bzCompressEnd(&_stream); return true; - return output; #endif return false; } diff --git a/util/env_posix.cc b/util/env_posix.cc index b53cd0103..1ccb32084 100644 --- a/util/env_posix.cc +++ b/util/env_posix.cc @@ -1047,16 +1047,16 @@ class PosixEnv : public Env { unique_ptr* result, const EnvOptions& options) { result->reset(); + // no support for mmap yet + if (options.use_mmap_writes || options.use_mmap_reads) { + return Status::NotSupported("No support for mmap read/write yet"); + } Status s; const int fd = open(fname.c_str(), O_CREAT | O_RDWR, 0644); if (fd < 0) { s = IOError(fname, errno); } else { SetFD_CLOEXEC(fd, &options); - // no support for mmap yet - if (options.use_mmap_writes || options.use_mmap_reads) { - return Status::NotSupported("No support for mmap read/write yet"); - } result->reset(new PosixRandomRWFile(fname, fd, options)); } return s;