aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/util.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 296842acc3..e58001842e 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -1112,7 +1112,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
}