diff options
| author | Wladimir J. van der Laan <[email protected]> | 2012-10-11 00:42:47 -0700 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2012-10-11 00:42:47 -0700 |
| commit | 16f3618c13c479b729349abc3b965df3f94342c5 (patch) | |
| tree | 4deef31f1a5e8d4ab70daf3ca254fb2e3996f8d1 /src/util.cpp | |
| parent | Merge pull request #1913 from sipa/noi2p (diff) | |
| parent | Use fdatasync instead of fsync on supported platforms (diff) | |
| download | discoin-16f3618c13c479b729349abc3b965df3f94342c5.tar.xz discoin-16f3618c13c479b729349abc3b965df3f94342c5.zip | |
Merge pull request #1879 from sipa/fdatasync
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 3eb2619e8..c72b84bfa 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1119,7 +1119,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 } |