aboutsummaryrefslogtreecommitdiff
path: root/src/leveldb
diff options
context:
space:
mode:
authorPieter Wuille <sipa@ulyssis.org>2013-08-20 15:11:55 +0200
committerPieter Wuille <sipa@ulyssis.org>2013-08-20 15:13:34 +0200
commitb28d8b423bddc860c5858a9df2982ce825835350 (patch)
treebf3b1a021dfd52f378ffc7352ae0b9ec7f5c1bc5 /src/leveldb
parentaf6a02a99bd767035f0096dc7c339a7b502319c3 (diff)
parent1bb86d6f154da45464eb8b009c298dccd1cb3dab (diff)
Merge leveldb subtree change.
* On Mac OS X fsync does not guarantee write to disk. Use fcntl F_FULLFSYNC instead.
Diffstat (limited to 'src/leveldb')
-rw-r--r--src/leveldb/port/port_posix.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/leveldb/port/port_posix.h b/src/leveldb/port/port_posix.h
index f2b89bffb9..21c845e211 100644
--- a/src/leveldb/port/port_posix.h
+++ b/src/leveldb/port/port_posix.h
@@ -62,12 +62,16 @@
#define fflush_unlocked fflush
#endif
-#if defined(OS_MACOSX) || defined(OS_FREEBSD) ||\
+#if defined(OS_FREEBSD) ||\
defined(OS_OPENBSD) || defined(OS_DRAGONFLYBSD)
// Use fsync() on platforms without fdatasync()
#define fdatasync fsync
#endif
+#if defined(OS_MACOSX)
+#define fdatasync(fd) fcntl(fd, F_FULLFSYNC, 0)
+#endif
+
#if defined(OS_ANDROID) && __ANDROID_API__ < 9
// fdatasync() was only introduced in API level 9 on Android. Use fsync()
// when targetting older platforms.