Skip to content

Commit 293ab8b

Browse files
committed
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 <[email protected]>
1 parent 1cc12d3 commit 293ab8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

storage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ struct rmtfd *storage_open(unsigned node, const char *path)
122122
fspath = alloca(pathlen);
123123
snprintf(fspath, pathlen, "%s/%s", storage_dir, file);
124124
if (!storage_read_only) {
125-
fd = open(fspath, O_RDWR);
125+
fd = open(fspath, O_RDWR | O_SYNC);
126126
if (fd < 0) {
127127
saved_errno = errno;
128128
fprintf(stderr, "[storage] failed to open '%s' (requested '%s'): %s\n",

0 commit comments

Comments
 (0)