]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/load-fragment.c
conf-parser: return mtime in config_parse() and friends 16048/head
authorLennart Poettering <lennart@poettering.net>
Tue, 2 Jun 2020 12:55:12 +0000 (14:55 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 2 Jun 2020 17:32:20 +0000 (19:32 +0200)
commit4f9ff96a55187927a4164a19df580329f4c6522b
treec3e1face3267f1d965bc4328f4a1a9c1b2427aee
parent5aca2e6733d35534f82359e5720b3dea1d1332e5
conf-parser: return mtime in config_parse() and friends

This is a follow-up for 9f83091e3cceb646a66fa9df89de6d9a77c21d86.

Instead of reading the mtime off the configuration files after reading,
let's do so before reading, but with the fd we read the data from. This
is not only cleaner (as it allows us to save one stat()), but also has
the benefit that we'll detect changes that happen while we read the
files.

This also reworks unit file drop-ins to use the common code for
determining drop-in mtime, instead of reading system clock for that.
27 files changed:
src/core/load-dropin.c
src/core/load-fragment.c
src/core/main.c
src/coredump/coredump.c
src/fuzz/fuzz-unit-file.c
src/home/homed-conf.c
src/journal-remote/journal-remote-main.c
src/journal-remote/journal-upload.c
src/journal/journald-server.c
src/login/logind-core.c
src/network/netdev/netdev.c
src/network/networkd-conf.c
src/network/networkd-network.c
src/nspawn/nspawn-settings.c
src/partition/repart.c
src/pstore/pstore.c
src/resolve/resolved-conf.c
src/resolve/resolved-dnssd.c
src/shared/conf-parser.c
src/shared/conf-parser.h
src/shared/install.c
src/shared/sleep-config.c
src/test/test-conf-parser.c
src/timesync/timesyncd-conf.c
src/tty-ask-password-agent/tty-ask-password-agent.c
src/udev/net/link-config.c
src/xdg-autostart-generator/xdg-autostart-service.c