diff options
author | Chris Fries <cfries@google.com> | 2019-05-06 11:46:51 -0500 |
---|---|---|
committer | craftju <craftju@google.com> | 2019-05-14 16:32:36 +0800 |
commit | 59dbd41876d3c682e6ca5eb6b1e6ee3b1c1ad06d (patch) | |
tree | 3431c9ed62a843b644a19e4e69fe879cff545458 /gpt-utils | |
parent | 2dfa2ff7b0b59fe5951dbc01e6e6c9bf7fd34c8f (diff) | |
download | bonito-59dbd41876d3c682e6ca5eb6b1e6ee3b1c1ad06d.tar.gz |
gpt-utils: Add fsync() in gpt_disk_commit()
After writing the contents to disk (such as marking a boot slot as
successful), we should additionally do an fsync() to make sure we commit
this information to disk before returning.
Bug: 131176531
Change-Id: I8e15981b0fb9fad959bcb1e50c0f18d96245366f
Diffstat (limited to 'gpt-utils')
-rw-r--r-- | gpt-utils/gpt-utils.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gpt-utils/gpt-utils.cpp b/gpt-utils/gpt-utils.cpp index 633b34b0..ff6e535f 100644 --- a/gpt-utils/gpt-utils.cpp +++ b/gpt-utils/gpt-utils.cpp @@ -1533,6 +1533,7 @@ int gpt_disk_commit(struct gpt_disk *disk) __func__); goto error; } + fsync(fd); close(fd); return 0; error: |