changeset 3620:0bf7033a5bfb draft

Merge pull request #1879 from sipa/fdatasync Use fdatasync instead of fsync on supported platforms
author Wladimir J. van der Laan <laanwj@gmail.com>
date Thu, 11 Oct 2012 00:42:47 -0700
parents 3871a1f86f1f (current diff) df28f9409455 (diff)
children f08ec5407d2b 2561fbfe0a60
files src/util.cpp
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -1119,7 +1119,11 @@
 #ifdef WIN32
     _commit(_fileno(fileout));
 #else
+    #if defined(__linux__) || defined(__NetBSD__)
+    fdatasync(fileno(fileout));
+    #else
     fsync(fileno(fileout));
+    #endif
 #endif
 }