From: Timo Sirainen Date: Mon, 9 Jan 2023 14:13:42 +0000 (+0200) Subject: config: config_parse_file() - Remove unused modules parameter X-Git-Tag: 2.4.0~3053 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06acbeb0b10a2489c50eb6f6b8ad66f55d94362d;p=thirdparty%2Fdovecot%2Fcore.git config: config_parse_file() - Remove unused modules parameter --- diff --git a/src/config/config-connection.c b/src/config/config-connection.c index 30eeb06ac4..d23884a861 100644 --- a/src/config/config-connection.c +++ b/src/config/config-connection.c @@ -58,7 +58,7 @@ static int config_connection_request(struct config_connection *conn, const char *path, *error; path = master_service_get_config_path(master_service); - if (config_parse_file(path, CONFIG_PARSE_FLAG_EXPAND_VALUES, NULL, &error) <= 0) { + if (config_parse_file(path, CONFIG_PARSE_FLAG_EXPAND_VALUES, &error) <= 0) { o_stream_nsend_str(conn->output, t_strconcat("-", error, "\n", NULL)); return 0; diff --git a/src/config/config-parser.c b/src/config/config-parser.c index b95d86e1d7..e5723bae1b 100644 --- a/src/config/config-parser.c +++ b/src/config/config-parser.c @@ -998,7 +998,7 @@ void config_parser_apply_line(struct config_parser_context *ctx, } int config_parse_file(const char *path, enum config_parse_flags flags, - const char *const *modules, const char **error_r) + const char **error_r) { struct input_stack root; struct config_parser_context ctx; @@ -1040,7 +1040,6 @@ int config_parse_file(const char *path, enum config_parse_flags flags, root.path = path; ctx.cur_input = &root; ctx.expand_values = (flags & CONFIG_PARSE_FLAG_EXPAND_VALUES) != 0; - ctx.modules = modules; hash_table_create(&ctx.seen_settings, ctx.pool, 0, str_hash, strcmp); p_array_init(&ctx.all_parsers, ctx.pool, 128); diff --git a/src/config/config-parser.h b/src/config/config-parser.h index 92ea73d1b3..4df3821124 100644 --- a/src/config/config-parser.h +++ b/src/config/config-parser.h @@ -23,7 +23,7 @@ extern struct module *modules; int config_parse_net(const char *value, struct ip_addr *ip_r, unsigned int *bits_r, const char **error_r); int config_parse_file(const char *path, enum config_parse_flags flags, - const char *const *modules, const char **error_r) + const char **error_r) ATTR_NULL(3); void config_parse_load_modules(void); diff --git a/src/config/doveconf.c b/src/config/doveconf.c index 27bc3eab17..182c4212c5 100644 --- a/src/config/doveconf.c +++ b/src/config/doveconf.c @@ -969,8 +969,7 @@ int main(int argc, char *argv[]) if (expand_vars) flags |= CONFIG_PARSE_FLAG_EXPAND_VALUES; if ((ret = config_parse_file(dump_defaults ? NULL : config_path, - flags, NULL, - &error)) == 0 && + flags, &error)) == 0 && access(EXAMPLE_CONFIG_DIR, X_OK) == 0) { i_fatal("%s (copy example configs from "EXAMPLE_CONFIG_DIR"/)", error); diff --git a/src/config/main.c b/src/config/main.c index 1a5b8eb777..1bef855658 100644 --- a/src/config/main.c +++ b/src/config/main.c @@ -34,7 +34,7 @@ int main(int argc, char *argv[]) config_parse_load_modules(); path = master_service_get_config_path(master_service); - if (config_parse_file(path, CONFIG_PARSE_FLAG_EXPAND_VALUES, NULL, &error) <= 0) + if (config_parse_file(path, CONFIG_PARSE_FLAG_EXPAND_VALUES, &error) <= 0) i_fatal("%s", error); /* notify about our success only after successfully parsing the diff --git a/src/config/test-config-parser.c b/src/config/test-config-parser.c index 5503d3da80..9ed0ef4122 100644 --- a/src/config/test-config-parser.c +++ b/src/config/test-config-parser.c @@ -117,7 +117,7 @@ static void test_config_parser(void) putenv("bar=test2"); putenv("FOO$ENV:FOO=works"); - test_assert(config_parse_file(TEST_CONFIG_FILE, CONFIG_PARSE_FLAG_EXPAND_VALUES, NULL, &error) == 1); + test_assert(config_parse_file(TEST_CONFIG_FILE, CONFIG_PARSE_FLAG_EXPAND_VALUES, &error) == 1); if (error != NULL) i_error("config_parse_file(): %s", error); @@ -138,7 +138,7 @@ static void test_config_parser(void) test_assert_strcmp(set->protocols, "pop3 imap"); /* try again unexpanded */ - test_assert(config_parse_file(TEST_CONFIG_FILE, 0, NULL, &error) == 1); + test_assert(config_parse_file(TEST_CONFIG_FILE, 0, &error) == 1); set = settings_parser_get(config_module_parsers[0].parser); test_assert_strcmp(set->key, "value");