Skip to content

Commit 1bb86d6

Browse files
committed
Squashed 'src/leveldb/' changes from a02ddf9..be1b0ff
be1b0ff On Mac OS X fsync does not guarantee write to disk. Use fcntl F_FULLFSYNC instead. git-subtree-dir: src/leveldb git-subtree-split: be1b0ff1fcd6ad820a7fd111ac671fb51cc68001
1 parent 84d6d69 commit 1bb86d6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

port/port_posix.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,16 @@
6262
#define fflush_unlocked fflush
6363
#endif
6464

65-
#if defined(OS_MACOSX) || defined(OS_FREEBSD) ||\
65+
#if defined(OS_FREEBSD) ||\
6666
defined(OS_OPENBSD) || defined(OS_DRAGONFLYBSD)
6767
// Use fsync() on platforms without fdatasync()
6868
#define fdatasync fsync
6969
#endif
7070

71+
#if defined(OS_MACOSX)
72+
#define fdatasync(fd) fcntl(fd, F_FULLFSYNC, 0)
73+
#endif
74+
7175
#if defined(OS_ANDROID) && __ANDROID_API__ < 9
7276
// fdatasync() was only introduced in API level 9 on Android. Use fsync()
7377
// when targetting older platforms.

0 commit comments

Comments
 (0)