Browse Source

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
0.10
Philip Kaufmann 11 years ago
parent
commit
4c0b2cde3a
  1. 3
      src/util.cpp

3
src/util.cpp

@ -1161,7 +1161,8 @@ void FileCommit(FILE *fileout) @@ -1161,7 +1161,8 @@ void FileCommit(FILE *fileout)
{
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));

Loading…
Cancel
Save