Abort ImportantFileWriter::WriteFileAtomically() on Flush() error.
As discussed on chromium-os-dev [1], if there is no fsync() after writing to the
temp file, atomicity is not guaranteed. Thus, to be able to guarantee
atomicity, we must check the return value of Flush() and bail in case Flush()
wasn't successful.
I'll update the UMA histogram enum in a separate CL.
[1] https://groups.google.com/a/chromium.org/forum/?hl=en#!topic/chromium-os-dev/Eef8gNIRwjc
BUG=none
Review URL: https://codereview.chromium.org/663463002
Cr-Commit-Position: refs/heads/master@{#300230}
CrOS-Libchrome-Original-Commit: 604e5c185a4f6a9c1a59525a45243e714983262a
1 file changed