Commit 73f3f949 authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

base: Use fdatasync() on Fuchsia.

This CL switches base::File::Flush() from fsync() to fdatasync() on
Fuchsia. This matches the behavior on all other POSIX platforms that
implement fdatasync().

Change-Id: I69406ff5091fca626004370d70b5530c4a23f2c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2394722
Commit-Queue: Victor Costan <pwnall@chromium.org>
Auto-Submit: Victor Costan <pwnall@chromium.org>
Reviewed-by: default avatarWez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813567}
parent 217ea452
......@@ -549,7 +549,8 @@ bool File::Flush() {
#if defined(OS_NACL)
NOTIMPLEMENTED(); // NaCl doesn't implement fsync.
return true;
#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
#elif defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_FUCHSIA) || \
defined(OS_LINUX)
return !HANDLE_EINTR(fdatasync(file_.get()));
#elif defined(OS_APPLE)
// On macOS and iOS, fsync() is guaranteed to send the file's data to the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment