update_engine: Add Flush() to FileDescriptor
This patch adds Flush() function to the file descriptor. This function
should be called after each operation in order to ensure that data
resides to disk before any checkpointing happen. In addition, if any
future file descriptor that caches the data is added, this ensures
integrity of written data.
BUG=chromium:762815
TEST=brillo_update_payload verify
Change-Id: I12442142647605afef1b01dc932eb7cf182af85b
Reviewed-on: https://chromium-review.googlesource.com/674163
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Sen Jiang <senj@chromium.org>
4 files changed