Skip to content

Commit

Permalink
Remove close when fd == -1. (facebook#12732)
Browse files Browse the repository at this point in the history
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: facebook#12732

Reviewed By: ltamasi

Differential Revision: D58170009

Pulled By: ajkr

fbshipit-source-id: 1fc6944c2667641996676a75aa3e91984070ba49
  • Loading branch information
aclamk authored and facebook-github-bot committed Jun 5, 2024
1 parent 61d10fe commit a211e06
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion env/io_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a211e06

Please sign in to comment.