aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2013-12-20 15:55:01 +0100
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2013-12-20 18:42:27 +0100
commit4c0b2cde3a68e65971ab7d9970a3419328d4fe0e (patch)
tree296d2fc574f5a10281a5ac78b0ce5854a7520431 /src/util.cpp
parent9e508b55885ba747dce2e3fd5ef4c05572cda0b0 (diff)
downloadbitcoin-4c0b2cde3a68e65971ab7d9970a3419328d4fe0e.tar.xz
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
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 280798f2fb..a7594c78b7 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -1159,9 +1159,10 @@ bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest)
void FileCommit(FILE *fileout)
{
- fflush(fileout); // harmless if redundantly called
+ fflush(fileout); // harmless if redundantly called
#ifdef WIN32
- _commit(_fileno(fileout));
+ HANDLE hFile = (HANDLE)_get_osfhandle(_fileno(fileout));
+ FlushFileBuffers(hFile);
#else
#if defined(__linux__) || defined(__NetBSD__)
fdatasync(fileno(fileout));