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
tree: 18309d2991ced762b4df34067a319ed4d8ca93d8
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/