Merge pull request #1879 from sipa/fdatasync

Use fdatasync instead of fsync on supported platforms
This commit is contained in:
Wladimir J. van der Laan 2012-10-11 00:42:47 -07:00
commit 16f3618c13

View File

@ -1118,9 +1118,13 @@ void FileCommit(FILE *fileout)
fflush(fileout); // harmless if redundantly called
#ifdef WIN32
_commit(_fileno(fileout));
#else
#if defined(__linux__) || defined(__NetBSD__)
fdatasync(fileno(fileout));
#else
fsync(fileno(fileout));
#endif
#endif
}
int GetFilesize(FILE* file)