tree-wide: make use of fsync_directory_of_file() all over the place

Let's make use this at various places we call fsync(), to make things
fully reliable, as the kernel devs suggest to first fsync() files and
then fsync() the directories they are located in.
This commit is contained in:
Lennart Poettering
2018-02-20 15:39:31 +01:00
parent 11b29a96e9
commit 8ac2f74fb6
4 changed files with 15 additions and 3 deletions
+4
View File
@@ -1187,6 +1187,10 @@ int fflush_sync_and_check(FILE *f) {
if (fsync(fileno(f)) < 0)
return -errno;
r = fsync_directory_of_file(fileno(f));
if (r < 0)
return r;
return 0;
}