From 07e0ffc8234b8212a6509fe6dbc1811be03fc3ae Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 27 Jan 2023 11:32:27 +0100 Subject: conf: replace config_parse_many_nulstr() with config_parse_config_file() All daemons use a similar scheme to read their main config files and theirs drop-ins. The main config files are always stored in /etc/systemd directory and it's easy enough to construct the name of the drop-in directories based on the name of the main config file. Hence the new helper does that internally, which allows to reduce and simplify the args passed previously to config_parse_many_nulstr(). Besides the overall code simplification it results: 16 files changed, 87 insertions(+), 159 deletions(-) it allows to identify clearly the locations in the code where configuration files are parsed. --- src/home/homed-conf.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'src/home') diff --git a/src/home/homed-conf.c b/src/home/homed-conf.c index 429a6e3c55..ffa4bb3bd7 100644 --- a/src/home/homed-conf.c +++ b/src/home/homed-conf.c @@ -6,23 +6,12 @@ #include "homed-conf.h" int manager_parse_config_file(Manager *m) { - int r; assert(m); - r = config_parse_many_nulstr( - PKGSYSCONFDIR "/homed.conf", - CONF_PATHS_NULSTR("systemd/homed.conf.d"), - "Home\0", - config_item_perf_lookup, homed_gperf_lookup, - CONFIG_PARSE_WARN, - m, - NULL); - if (r < 0) - return r; - - return 0; - + return config_parse_config_file("homed.conf", "Home\0", + config_item_perf_lookup, homed_gperf_lookup, + CONFIG_PARSE_WARN, m); } DEFINE_CONFIG_PARSE_ENUM(config_parse_default_storage, user_storage, UserStorage, "Failed to parse default storage setting"); -- cgit v1.2.1