From e9965213907bf5dee4ae54be38f9c048aa124644 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 28 Sep 2012 14:27:20 +0200 Subject: [PATCH] Use fdatasync instead of fsync on supported platforms --- src/util.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util.cpp b/src/util.cpp index 296842acc30..e58001842ee 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 }