From ecb74bae0d7409a2ec37279099faad30d301b031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Wed, 6 Oct 2021 12:59:45 +0200 Subject: [PATCH] dns/resolver.c: Return void when ISC_R_SUCCESS is only returned value With isc_mem_get() and dns_name_dup() no longer being able to fail, some functions can now only return ISC_R_SUCCESS. Change the return type to void for the following function(s): * dns_resolver_addalternate() --- bin/named/server.c | 6 +++--- lib/dns/include/dns/resolver.h | 2 +- lib/dns/resolver.c | 4 +--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bin/named/server.c b/bin/named/server.c index 94d44d48d3..113a838be7 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -6074,8 +6074,8 @@ configure_alternates(const cfg_obj_t *config, dns_view_t *view, } myport = (in_port_t)val; } - CHECK(dns_resolver_addalternate(view->resolver, NULL, - name, myport)); + dns_resolver_addalternate(view->resolver, NULL, name, + myport); continue; } @@ -6083,7 +6083,7 @@ configure_alternates(const cfg_obj_t *config, dns_view_t *view, if (isc_sockaddr_getport(&sa) == 0) { isc_sockaddr_setport(&sa, port); } - CHECK(dns_resolver_addalternate(view->resolver, &sa, NULL, 0)); + dns_resolver_addalternate(view->resolver, &sa, NULL, 0); } cleanup: diff --git a/lib/dns/include/dns/resolver.h b/lib/dns/include/dns/resolver.h index 918bddf928..85d81c0c8a 100644 --- a/lib/dns/include/dns/resolver.h +++ b/lib/dns/include/dns/resolver.h @@ -434,7 +434,7 @@ dns_resolver_setlamettl(dns_resolver_t *resolver, uint32_t lame_ttl); *\li 'resolver' to be valid. */ -isc_result_t +void dns_resolver_addalternate(dns_resolver_t *resolver, const isc_sockaddr_t *alt, const dns_name_t *name, in_port_t port); /*%< diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 7a50004310..1402dd786f 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -10708,7 +10708,7 @@ dns_resolver_setlamettl(dns_resolver_t *resolver, uint32_t lame_ttl) { resolver->lame_ttl = lame_ttl; } -isc_result_t +void dns_resolver_addalternate(dns_resolver_t *resolver, const isc_sockaddr_t *alt, const dns_name_t *name, in_port_t port) { alternate_t *a; @@ -10729,8 +10729,6 @@ dns_resolver_addalternate(dns_resolver_t *resolver, const isc_sockaddr_t *alt, } ISC_LINK_INIT(a, link); ISC_LIST_APPEND(resolver->alternates, a, link); - - return (ISC_R_SUCCESS); } void