Add new utility functions FileCommit(), RenameOver()

This commit is contained in:
Jeff Garzik
2012-05-12 01:24:27 -04:00
committed by Jeff Garzik
parent 49232d1abf
commit 768e5d52fb
3 changed files with 24 additions and 7 deletions

View File

@@ -956,13 +956,7 @@ public:
// Flush stdio buffers and commit to disk before returning
fflush(fileout);
if (!IsInitialBlockDownload() || (nBestHeight+1) % 500 == 0)
{
#ifdef WIN32
_commit(_fileno(fileout));
#else
fsync(fileno(fileout));
#endif
}
FileCommit(fileout);
return true;
}