Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: third_party/leveldatabase/env_chromium.cc

Issue 23549017: Do fcntl(...F_FULLFSYNC...) on mac instead of fsync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/leveldatabase/env_chromium.cc
diff --git a/third_party/leveldatabase/env_chromium.cc b/third_party/leveldatabase/env_chromium.cc
index 0333380fd2f3e6ac0dff4318b52eda1b0445144c..562929b8482ad52f28d8dba8db4cabafa68a5c5c 100644
--- a/third_party/leveldatabase/env_chromium.cc
+++ b/third_party/leveldatabase/env_chromium.cc
@@ -68,6 +68,8 @@ int fflush_wrapper(FILE *file) {
int fdatasync(int fildes) {
#if defined(OS_WIN)
return _commit(fildes);
+#elif defined(OS_MACOSX)
+ return HANDLE_EINTR(fcntl(fildes, F_FULLFSYNC, 0));
jsbell 2013/09/04 23:59:34 Can fcntl() produce an EINTR error on MacOS with F
dgrogan 2013/09/05 00:01:32 Yeah, I added it just in case the man page was inc
#else
return HANDLE_EINTR(fsync(fildes));
#endif
@@ -510,7 +512,7 @@ Status ChromiumWritableFile::Sync() {
error = errno;
// Sync even if fflush gave an error; perhaps the data actually got out,
// even though something went wrong.
- if (fdatasync(fileno(file_)) && !error)
+ if (fdatasync(fileno(file_)) == -1 && !error)
jsbell 2013/09/04 23:59:34 Nice catch.
error = errno;
// Report the first error we found.
if (error) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698