diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2012-09-28 14:27:20 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2012-10-07 15:51:40 +0200 |
commit | e9965213907bf5dee4ae54be38f9c048aa124644 (patch) | |
tree | ce29a9301628324db4f79a7b4178fcd2b877583b /src/util.cpp | |
parent | ee0b64853699c08602fed81cdefc62d7e8dcdce2 (diff) |
Use fdatasync instead of fsync on supported platforms
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 4 |
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 } |