mirror of https://github.com/facebook/rocksdb.git
Remove close when fd == -1. (#12732)
Summary: Its polluting my valgrind runs: ==3733139== Warning: invalid file descriptor -1 in syscall close() ==3733139== Warning: invalid file descriptor -1 in syscall close() ==3733139== Warning: invalid file descriptor -1 in syscall close() Pull Request resolved: https://github.com/facebook/rocksdb/pull/12732 Reviewed By: ltamasi Differential Revision: D58170009 Pulled By: ajkr fbshipit-source-id: 1fc6944c2667641996676a75aa3e91984070ba49
This commit is contained in:
parent
61d10fe0c3
commit
a211e06552
|
@ -457,7 +457,6 @@ Status PosixHelper::GetLogicalBlockSizeOfDirectory(const std::string& directory,
|
|||
size_t* size) {
|
||||
int fd = open(directory.c_str(), O_DIRECTORY | O_RDONLY);
|
||||
if (fd == -1) {
|
||||
close(fd);
|
||||
return Status::IOError("Cannot open directory " + directory);
|
||||
}
|
||||
*size = PosixHelper::GetLogicalBlockSizeOfFd(fd);
|
||||
|
|
Loading…
Reference in New Issue