summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-02-03 11:23:27 -0500
committerEliot Horowitz <eliot@10gen.com>2011-02-03 11:23:27 -0500
commit38364885c5fb0e171b45ce82c3e9569c81204098 (patch)
tree0dcb43dd5a6e868f2e4b3261de23cb3fbb2fbecb /util
parent4c26ae7633db58c0c5b89cc3bf6cbe9183838b12 (diff)
downloadmongo-38364885c5fb0e171b45ce82c3e9569c81204098.tar.gz
fdatasync is linux only
Diffstat (limited to 'util')
-rw-r--r--util/logfile.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/util/logfile.cpp b/util/logfile.cpp
index a1ad982e52b..7068f3b35d4 100644
--- a/util/logfile.cpp
+++ b/util/logfile.cpp
@@ -140,7 +140,13 @@ namespace mongo {
uasserted(13515, str::stream() << "error appending to file " << _fd << ' ' << errnoWithDescription());
}
- if( fdatasync(_fd) < 0 ) {
+ if(
+#if defined(__linux__)
+ fdatasync(_fd) < 0
+#else
+ fsync(_fd)
+#endif
+ ) {
uasserted(13514, str::stream() << "error appending to file on fsync " << ' ' << errnoWithDescription());
}