diff options
| author | Pieter Wuille <[email protected]> | 2012-09-28 14:27:20 +0200 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2012-10-07 15:51:40 +0200 |
| commit | e9965213907bf5dee4ae54be38f9c048aa124644 (patch) | |
| tree | ce29a9301628324db4f79a7b4178fcd2b877583b /src/util.cpp | |
| parent | Merge pull request #1906 from laanwj/2012_10_help_stdout (diff) | |
| download | discoin-e9965213907bf5dee4ae54be38f9c048aa124644.tar.xz discoin-e9965213907bf5dee4ae54be38f9c048aa124644.zip | |
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 296842acc..e58001842 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 } |