diff options
author | Bjorn Andersson <bjorn.andersson@linaro.org> | 2021-04-08 11:54:41 -0500 |
---|---|---|
committer | Bjorn Andersson <bjorn.andersson@linaro.org> | 2021-04-08 11:56:53 -0500 |
commit | 293ab8babb27ac0f24247bb101fed9420c629c29 (patch) | |
tree | 8eee9ee0841e75df48e07efa4c91087a292341fa | |
parent | 1cc12d3dc1f251f6d3151970621a06fdd013a1d0 (diff) |
storage: Sync changes
Open the storage devices as O_SYNC, to make sure modem writes aren't
lingering in the event of power loss or sudden reboot.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
-rw-r--r-- | storage.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -122,7 +122,7 @@ found: fspath = alloca(pathlen); snprintf(fspath, pathlen, "%s/%s", storage_dir, file); if (!storage_read_only) { - fd = open(fspath, O_RDWR); + fd = open(fspath, O_RDWR | O_SYNC); if (fd < 0) { saved_errno = errno; fprintf(stderr, "[storage] failed to open '%s' (requested '%s'): %s\n", |