mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-06 13:17:44 +03:00
config-parser: Add list of drop-in files as return argument of config_parse_many
This will be used to save the list of drop-in files for each partition
This commit is contained in:
parent
65c2ad985a
commit
ead3a3fc87
@ -691,6 +691,7 @@ static int parse_config_file(void) {
|
||||
config_item_table_lookup, items,
|
||||
CONFIG_PARSE_WARN,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
/* Traditionally "0" was used to turn off the default unit timeouts. Fix this up so that we use
|
||||
|
@ -1746,7 +1746,7 @@ static int server_parse_config_file(Server *s) {
|
||||
dropin_dirname,
|
||||
"Journal\0",
|
||||
config_item_perf_lookup, journald_gperf_lookup,
|
||||
CONFIG_PARSE_WARN, s, NULL);
|
||||
CONFIG_PARSE_WARN, s, NULL, NULL);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
@ -789,6 +789,7 @@ int netdev_load_one(Manager *manager, const char *filename) {
|
||||
config_item_perf_lookup, network_netdev_gperf_lookup,
|
||||
CONFIG_PARSE_WARN,
|
||||
netdev_raw,
|
||||
NULL,
|
||||
NULL);
|
||||
if (r < 0)
|
||||
return r; /* config_parse_many() logs internally. */
|
||||
@ -823,7 +824,7 @@ int netdev_load_one(Manager *manager, const char *filename) {
|
||||
NETDEV_VTABLE(netdev)->sections,
|
||||
config_item_perf_lookup, network_netdev_gperf_lookup,
|
||||
CONFIG_PARSE_WARN,
|
||||
netdev, NULL);
|
||||
netdev, NULL, NULL);
|
||||
if (r < 0)
|
||||
return r; /* config_parse_many() logs internally. */
|
||||
|
||||
|
@ -550,7 +550,8 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
|
||||
config_item_perf_lookup, network_network_gperf_lookup,
|
||||
CONFIG_PARSE_WARN,
|
||||
network,
|
||||
&network->stats_by_path);
|
||||
&network->stats_by_path,
|
||||
NULL);
|
||||
if (r < 0)
|
||||
return r; /* config_parse_many() logs internally. */
|
||||
|
||||
|
@ -93,6 +93,7 @@ static int dnssd_service_load(Manager *manager, const char *filename) {
|
||||
config_item_perf_lookup, resolved_dnssd_gperf_lookup,
|
||||
CONFIG_PARSE_WARN,
|
||||
service,
|
||||
NULL,
|
||||
NULL);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
@ -588,7 +588,8 @@ int config_parse_many(
|
||||
const void *table,
|
||||
ConfigParseFlags flags,
|
||||
void *userdata,
|
||||
Hashmap **ret_stats_by_path) {
|
||||
Hashmap **ret_stats_by_path,
|
||||
char ***ret_dropin_files) {
|
||||
|
||||
_cleanup_strv_free_ char **files = NULL;
|
||||
int r;
|
||||
@ -602,7 +603,14 @@ int config_parse_many(
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
return config_parse_many_files(conf_files, files, sections, lookup, table, flags, userdata, ret_stats_by_path);
|
||||
r = config_parse_many_files(conf_files, files, sections, lookup, table, flags, userdata, ret_stats_by_path);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (ret_dropin_files)
|
||||
*ret_dropin_files = TAKE_PTR(files);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dropins_get_stats_by_path(
|
||||
|
@ -112,7 +112,8 @@ int config_parse_many(
|
||||
const void *table,
|
||||
ConfigParseFlags flags,
|
||||
void *userdata,
|
||||
Hashmap **ret_stats_by_path); /* possibly NULL */
|
||||
Hashmap **ret_stats_by_path, /* possibly NULL */
|
||||
char ***ret_drop_in_files); /* possibly NULL */
|
||||
|
||||
int config_get_stats_by_path(
|
||||
const char *suffix,
|
||||
|
@ -264,7 +264,8 @@ int link_load_one(LinkConfigContext *ctx, const char *filename) {
|
||||
"Link\0"
|
||||
"SR-IOV\0",
|
||||
config_item_perf_lookup, link_config_gperf_lookup,
|
||||
CONFIG_PARSE_WARN, config, &stats_by_path);
|
||||
CONFIG_PARSE_WARN, config, &stats_by_path,
|
||||
NULL);
|
||||
if (r < 0)
|
||||
return r; /* config_parse_many() logs internally. */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user