diff --git a/src/util.cpp b/src/util.cpp index 3eb2619e8..c72b84bfa 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1119,7 +1119,11 @@ void FileCommit(FILE *fileout) #ifdef WIN32 _commit(_fileno(fileout)); #else + #if defined(__linux__) || defined(__NetBSD__) + fdatasync(fileno(fileout)); + #else fsync(fileno(fileout)); + #endif #endif }