aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2013-08-20 15:11:55 +0200
committerPieter Wuille <[email protected]>2013-08-20 15:11:55 +0200
commit1bb86d6f154da45464eb8b009c298dccd1cb3dab (patch)
treebc515a2d36881dde9dc3c5200b729ec0c67304c8
parentSquashed 'src/leveldb/' changes from ae6c262..a02ddf9 (diff)
downloaddiscoin-1bb86d6f154da45464eb8b009c298dccd1cb3dab.tar.xz
discoin-1bb86d6f154da45464eb8b009c298dccd1cb3dab.zip
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
-rw-r--r--port/port_posix.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/port/port_posix.h b/port/port_posix.h
index f2b89bffb..21c845e21 100644
--- a/port/port_posix.h
+++ b/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.