Skip to content

Commit 246727c

Browse files
committed
Fix fdatasync for Mac OS X
1 parent 7866215 commit 246727c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/CopyOpenFile.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ void CopyOpenFile::fsync() {
5555
}
5656

5757
void CopyOpenFile::fdatasync() {
58+
#ifdef F_FULLFSYNC
59+
// This is MacOSX, which doesn't know fdatasync
60+
int retval = fcntl(_descriptor, F_FULLFSYNC);
61+
#else
5862
int retval = ::fdatasync(_descriptor);
63+
#endif
5964
CHECK_RETVAL(retval);
6065
}
6166

0 commit comments

Comments
 (0)