Mac build break caused by include/posix/io_posix.h not declearing errno,

Summary: Mac build breaks as include/posix/io_posix.h doesn't include errno. Move the exact function declaration to io_posix.cc

Test Plan: Run all test. Will run on Mac

Reviewers: rven, anthony, yhchiang, IslamAbdelRahman, igor

Subscribers: leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D49551
This commit is contained in:
sdong 2015-10-27 12:15:55 -07:00
parent beb69d4511
commit d6219e4d9b
2 changed files with 11 additions and 8 deletions

View File

@ -164,14 +164,8 @@ class PosixMmapFile : public WritableFile {
class PosixDirectory : public Directory {
public:
explicit PosixDirectory(int fd) : fd_(fd) {}
~PosixDirectory() { close(fd_); }
virtual Status Fsync() override {
if (fsync(fd_) == -1) {
return IOError("directory", errno);
}
return Status::OK();
}
~PosixDirectory();
virtual Status Fsync() override;
private:
int fd_;

View File

@ -633,5 +633,14 @@ size_t PosixWritableFile::GetUniqueId(char* id, size_t max_size) const {
return GetUniqueIdFromFile(fd_, id, max_size);
}
#endif
PosixDirectory::~PosixDirectory() { close(fd_); }
Status PosixDirectory::Fsync() {
if (fsync(fd_) == -1) {
return IOError("directory", errno);
}
return Status::OK();
}
} // namespace rocksdb
#endif