mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-15 21:15:14 +02:00
Win32: use a more modern API call in FileCommit()
- this seems to be a more recent API call and also supports e.g. SMB3, ReFS, which is not guaranteed for commit_() - link to MSDN: http://msdn.microsoft.com/en-us/library/windows/desktop/aa364439%28v=vs.85%29.aspx
This commit is contained in:
@ -1159,9 +1159,10 @@ bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest)
|
|||||||
|
|
||||||
void FileCommit(FILE *fileout)
|
void FileCommit(FILE *fileout)
|
||||||
{
|
{
|
||||||
fflush(fileout); // harmless if redundantly called
|
fflush(fileout); // harmless if redundantly called
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
_commit(_fileno(fileout));
|
HANDLE hFile = (HANDLE)_get_osfhandle(_fileno(fileout));
|
||||||
|
FlushFileBuffers(hFile);
|
||||||
#else
|
#else
|
||||||
#if defined(__linux__) || defined(__NetBSD__)
|
#if defined(__linux__) || defined(__NetBSD__)
|
||||||
fdatasync(fileno(fileout));
|
fdatasync(fileno(fileout));
|
||||||
|
Reference in New Issue
Block a user