Index: base/files/file_posix.cc |
diff --git a/base/files/file_posix.cc b/base/files/file_posix.cc |
index 517390f8eacf71135f9e62aff00de4a2d2b7f337..0a3076177569a1a699a9650fa683fb3553ab24a7 100644 |
--- a/base/files/file_posix.cc |
+++ b/base/files/file_posix.cc |
@@ -433,6 +433,16 @@ bool File::Flush() { |
return !CallFsync(file_.get()); |
} |
+bool File::FlushData() { |
+#if defined(OS_LINUX) || defined(OS_ANDROID) |
+ base::ThreadRestrictions::AssertIOAllowed(); |
+ DCHECK(IsValid()); |
+ return !HANDLE_EINTR(fdatasync(file_.get())); |
rvargas (doing something else)
2015/03/20 18:56:05
is fdatasync a Linux-only thing? What's the behavi
hashimoto
2015/03/20 19:38:57
fdatasync is a part of POSIX, but it's not mandato
|
+#else |
+ return Flush(); |
+#endif |
+} |
+ |
bool File::SetTimes(Time last_access_time, Time last_modified_time) { |
base::ThreadRestrictions::AssertIOAllowed(); |
DCHECK(IsValid()); |