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 { class PosixDirectory : public Directory {
public: public:
explicit PosixDirectory(int fd) : fd_(fd) {} explicit PosixDirectory(int fd) : fd_(fd) {}
~PosixDirectory() { close(fd_); } ~PosixDirectory();
virtual Status Fsync() override;
virtual Status Fsync() override {
if (fsync(fd_) == -1) {
return IOError("directory", errno);
}
return Status::OK();
}
private: private:
int fd_; int fd_;

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

Loading…
Cancel
Save