mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-05 18:52:29 +02:00
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.
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
05ea79052c
commit
f46f128b9a
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user