fileio: sync directory after rename, too

This commit is contained in:
Lennart Poettering 2020-05-20 17:14:48 +02:00
parent cbffdcecae
commit 5b3f4a20ea
1 changed files with 7 additions and 0 deletions

View File

@ -202,6 +202,13 @@ static int write_string_file_atomic(
goto fail;
}
if (FLAGS_SET(flags, WRITE_STRING_FILE_SYNC)) {
/* Sync the rename, too */
r = fsync_directory_of_file(fileno(f));
if (r < 0)
return r;
}
return 0;
fail: