From: Vladimír Čunát Date: Thu, 15 Jun 2017 07:52:39 +0000 (+0200) Subject: hints nitpicks: inline unload() into hints_deinit() X-Git-Tag: v1.3.2~5^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=590dab7655f88d324b0a7bb3aabafdffee8bcd97;p=thirdparty%2Fknot-resolver.git hints nitpicks: inline unload() into hints_deinit() The API function doesn't do anything else anyway. --- diff --git a/modules/hints/hints.c b/modules/hints/hints.c index c64805276..f08fef0db 100644 --- a/modules/hints/hints.c +++ b/modules/hints/hints.c @@ -365,17 +365,6 @@ static char* hint_add_hosts(void *env, struct kr_module *module, const char *arg return bool2jsonstr(err == kr_ok()); } -static void unload(struct kr_module *module) -{ - struct hints_data *data = module->data; - if (data) { - kr_zonecut_deinit(&data->hints); - kr_zonecut_deinit(&data->reverse_hints); - mp_delete(data->hints.pool->ctx); - module->data = NULL; - } -} - /** * Set name => address hint. * @@ -583,6 +572,19 @@ int hints_init(struct kr_module *module) return kr_ok(); } +KR_EXPORT +int hints_deinit(struct kr_module *module) +{ + struct hints_data *data = module->data; + if (data) { + kr_zonecut_deinit(&data->hints); + kr_zonecut_deinit(&data->reverse_hints); + mp_delete(data->hints.pool->ctx); + module->data = NULL; + } + return kr_ok(); +} + /** Drop all hints, and load a hosts file if any was specified. * * It seems slightly strange to drop all, but keep doing that for now. @@ -590,7 +592,7 @@ int hints_init(struct kr_module *module) KR_EXPORT int hints_config(struct kr_module *module, const char *conf) { - unload(module); + hints_deinit(module); int err = hints_init(module); if (err != kr_ok()) { return err; @@ -602,13 +604,6 @@ int hints_config(struct kr_module *module, const char *conf) return kr_ok(); } -KR_EXPORT -int hints_deinit(struct kr_module *module) -{ - unload(module); - return kr_ok(); -} - KR_EXPORT struct kr_prop *hints_props(void) {