diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-02-19 18:24:36 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-02-20 15:39:31 +0100 |
commit | 8ac2f74fb6bb798db1fb3f7a7bf97f2579e963c2 (patch) | |
tree | 8f8a5c71c02e842055c90db92fc9ee9271bce9f9 /src/coredump | |
parent | fs-util: move fsync_directory_of_file() into generic code (diff) | |
download | systemd-8ac2f74fb6bb798db1fb3f7a7bf97f2579e963c2.tar.xz systemd-8ac2f74fb6bb798db1fb3f7a7bf97f2579e963c2.zip |
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.
Diffstat (limited to 'src/coredump')
-rw-r--r-- | src/coredump/coredump.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c index 6900af9fb5..e924750d1b 100644 --- a/src/coredump/coredump.c +++ b/src/coredump/coredump.c @@ -260,6 +260,8 @@ static int fix_permissions( if (fsync(fd) < 0) return log_error_errno(errno, "Failed to sync coredump %s: %m", coredump_tmpfile_name(filename)); + (void) fsync_directory_of_file(fd); + r = link_tmpfile(fd, filename, target); if (r < 0) return log_error_errno(r, "Failed to move coredump %s into place: %m", target); |