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
main
sdong 9 years ago
parent beb69d4511
commit d6219e4d9b
  1. 10
      include/posix/io_posix.h
  2. 9
      util/io_posix.cc

@ -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_;

@ -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

Loading…
Cancel
Save