summaryrefslogtreecommitdiffstats
path: root/src/pstore
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-13 19:31:21 +0100
commit07e0ffc8234b8212a6509fe6dbc1811be03fc3ae (patch)
treec6e3c15a443bad9f9f6c9c2f220e3fa352cc0f35 /src/pstore
parentMerge pull request #26781 from mrc0mmand/tests-again (diff)
downloadsystemd-07e0ffc8234b8212a6509fe6dbc1811be03fc3ae.tar.xz
systemd-07e0ffc8234b8212a6509fe6dbc1811be03fc3ae.zip
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/pstore')
-rw-r--r--src/pstore/pstore.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/pstore/pstore.c b/src/pstore/pstore.c
index e8c2145060..fa6d6ec0e9 100644
--- a/src/pstore/pstore.c
+++ b/src/pstore/pstore.c
@@ -77,14 +77,9 @@ static int parse_config(void) {
{}
};
- return config_parse_many_nulstr(
- PKGSYSCONFDIR "/pstore.conf",
- CONF_PATHS_NULSTR("systemd/pstore.conf.d"),
- "PStore\0",
- config_item_table_lookup, items,
- CONFIG_PARSE_WARN,
- NULL,
- NULL);
+ return config_parse_config_file("pstore.conf", "PStore\0",
+ config_item_table_lookup, items,
+ CONFIG_PARSE_WARN, NULL);
}
/* File list handling - PStoreEntry is the struct and