aboutsummaryrefslogtreecommitdiffstats
path: root/src/xdg-autostart-generator/xdg-autostart-service.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-06-02 14:55:12 +0200
committerLennart Poettering <lennart@poettering.net>2020-06-02 19:32:20 +0200
commit4f9ff96a55187927a4164a19df580329f4c6522b (patch)
treec3e1face3267f1d965bc4328f4a1a9c1b2427aee /src/xdg-autostart-generator/xdg-autostart-service.c
parentconf-parse: fix pretty bad typo (diff)
downloadsystemd-4f9ff96a55187927a4164a19df580329f4c6522b.tar.xz
systemd-4f9ff96a55187927a4164a19df580329f4c6522b.zip
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.
Diffstat (limited to 'src/xdg-autostart-generator/xdg-autostart-service.c')
-rw-r--r--src/xdg-autostart-generator/xdg-autostart-service.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/xdg-autostart-generator/xdg-autostart-service.c b/src/xdg-autostart-generator/xdg-autostart-service.c
index c99b6cc8839..6d10d7052b5 100644
--- a/src/xdg-autostart-generator/xdg-autostart-service.c
+++ b/src/xdg-autostart-generator/xdg-autostart-service.c
@@ -319,7 +319,8 @@ XdgAutostartService *xdg_autostart_service_parse_desktop(const char *path) {
r = config_parse(NULL, service->path, NULL,
"Desktop Entry\0",
xdg_config_item_table_lookup, items,
- CONFIG_PARSE_WARN, service);
+ CONFIG_PARSE_WARN, service,
+ NULL);
/* If parsing failed, only hide the file so it will still mask others. */
if (r < 0) {
log_warning_errno(r, "Failed to parse %s, ignoring it", service->path);