Skip to content

Commit

Permalink
Fix some errors detected by coverity scan
Browse files Browse the repository at this point in the history
Summary: Nothing major, just an extra return line and posibility of leaking fb in NewRandomRWFile

Test Plan: make check

Reviewers: kailiu, dhruba

Reviewed By: kailiu

CC: leveldb

Differential Revision: https://reviews.facebook.net/D15993
  • Loading branch information
igorcanadi committed Feb 7, 2014
1 parent 1d08140 commit d53b188
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion port/port_posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions util/env_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1047,16 +1047,16 @@ class PosixEnv : public Env {
unique_ptr<RandomRWFile>* 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;
Expand Down

0 comments on commit d53b188

Please sign in to comment.