aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-01-29 09:09:03 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2014-01-29 09:09:50 +0100
commitaab8fc58c6e6dc6e0a104170bd2aa10dc1af5dea (patch)
treeb5d31d826f237f7ea40be85349383d5cd4252e82 /src
parent2383e4883d2ba8ff21fc21a766a95ea711aa0bd7 (diff)
parent4c0b2cde3a68e65971ab7d9970a3419328d4fe0e (diff)
downloadbitcoin-aab8fc58c6e6dc6e0a104170bd2aa10dc1af5dea.tar.xz
Merge pull request #3450
4c0b2cd Win32: use a more modern API call in FileCommit() (Philip Kaufmann)
Diffstat (limited to 'src')
-rw-r--r--src/util.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 255226ea1e..7d748ac3bf 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -1101,9 +1101,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));