summaryrefslogtreecommitdiff
path: root/src/timesync
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2023-01-27 11:32:27 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-03-14 03:31:21 +0900
commit07e0ffc8234b8212a6509fe6dbc1811be03fc3ae (patch)
treec6e3c15a443bad9f9f6c9c2f220e3fa352cc0f35 /src/timesync
parent4fed028ae48e0b70325d78dd7e44e7f776a7aa0a (diff)
downloadsystemd-07e0ffc8234b8212a6509fe6dbc1811be03fc3ae.tar.gz
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.
Diffstat (limited to 'src/timesync')
-rw-r--r--src/timesync/timesyncd-conf.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/timesync/timesyncd-conf.c b/src/timesync/timesyncd-conf.c
index 3e6cb43597..9c0b6f7ce1 100644
--- a/src/timesync/timesyncd-conf.c
+++ b/src/timesync/timesyncd-conf.c
@@ -102,14 +102,9 @@ int manager_parse_config_file(Manager *m) {
assert(m);
- r = config_parse_many_nulstr(
- PKGSYSCONFDIR "/timesyncd.conf",
- CONF_PATHS_NULSTR("systemd/timesyncd.conf.d"),
- "Time\0",
- config_item_perf_lookup, timesyncd_gperf_lookup,
- CONFIG_PARSE_WARN,
- m,
- NULL);
+ r = config_parse_config_file("timesyncd.conf", "Time\0",
+ config_item_perf_lookup, timesyncd_gperf_lookup,
+ CONFIG_PARSE_WARN, m);
if (r < 0)
return r;