aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2013-09-15 20:14:06 -0700
committerWladimir J. van der Laan <laanwj@gmail.com>2013-11-26 14:00:47 +0100
commitf46f128b9a60765c68dd9fbe66d7f7778914900b (patch)
tree3359ba1bb5ab9baf75b7b4b108a1f1a4753a82ef
parent05ea79052c1cc88f901d570cdded32b25a361759 (diff)
More fixes for blockchain corruption on OSX.
As we'd previously learned, OSX's fsync is a data eating lie. Since 0.8.4 we're still getting some reports of disk corruption on OSX but now all of it looks like the block files have gotten out of sync with the database. It turns out that we were still using fsync() on the block files, so this isn't surprising.
-rw-r--r--src/util.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 4c9b897f57..481fc763cc 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -1147,6 +1147,8 @@ void FileCommit(FILE *fileout)
#else
#if defined(__linux__) || defined(__NetBSD__)
fdatasync(fileno(fileout));
+ #elif defined(__APPLE__) && defined(F_FULLFSYNC)
+ fcntl(fileno(fileout), F_FULLFSYNC, 0);
#else
fsync(fileno(fileout));
#endif