1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

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

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: