diff options
| author | Gregory Maxwell <[email protected]> | 2013-09-15 20:14:06 -0700 |
|---|---|---|
| committer | Gregory Maxwell <[email protected]> | 2013-09-15 20:34:29 -0700 |
| commit | e7bad10c12ce9b5d424ac273c1c977b88469d46c (patch) | |
| tree | ae1d4e23d07b29de67ee49c441ace816fee0a495 /src/util.cpp | |
| parent | Merge pull request #2996 from theuni/qt-translation (diff) | |
| download | discoin-e7bad10c12ce9b5d424ac273c1c977b88469d46c.tar.xz discoin-e7bad10c12ce9b5d424ac273c1c977b88469d46c.zip | |
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.
Diffstat (limited to 'src/util.cpp')
| -rw-r--r-- | src/util.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp index 136a03548..16c8f3fc1 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1156,6 +1156,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 |