changeset 3598:df28f9409455 draft

Use fdatasync instead of fsync on supported platforms
author Pieter Wuille <pieter.wuille@gmail.com>
date Fri, 28 Sep 2012 14:27:20 +0200
parents 5a7e013bf2e7
children 0bf7033a5bfb
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
@@ -1112,7 +1112,11 @@
 #ifdef WIN32
     _commit(_fileno(fileout));
 #else
+    #if defined(__linux__) || defined(__NetBSD__)
+    fdatasync(fileno(fileout));
+    #else
     fsync(fileno(fileout));
+    #endif
 #endif
 }