2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 05:28:00 +00:00

Make dns_catz_get_iterator() return void

Previously, the function(s) in the commit subject could fail for various
reasons - mostly allocation failures, or other functions returning
different return code than ISC_R_SUCCESS.  Now, the aforementioned
function(s) cannot ever fail and they would always return ISC_R_SUCCESS.

Change the function(s) to return void and remove the extra checks in
the code that uses them.
This commit is contained in:
Ondřej Surý 2022-03-08 11:30:37 +01:00
parent 8fa27365ec
commit d128656d2e
3 changed files with 4 additions and 14 deletions

View File

@ -3027,13 +3027,7 @@ configure_catz_zone(dns_view_t *view, dns_view_t *pview,
* We have to walk through all the member zones and attach * We have to walk through all the member zones and attach
* them to current view * them to current view
*/ */
result = dns_catz_get_iterator(zone, &it); dns_catz_get_iterator(zone, &it);
if (result != ISC_R_SUCCESS) {
cfg_obj_log(catz_obj, named_g_lctx,
DNS_CATZ_ERROR_LEVEL,
"catz: unable to create iterator");
goto cleanup;
}
for (result = isc_ht_iter_first(it); result == ISC_R_SUCCESS; for (result = isc_ht_iter_first(it); result == ISC_R_SUCCESS;
result = isc_ht_iter_next(it)) result = isc_ht_iter_next(it))

View File

@ -2025,10 +2025,9 @@ dns_catz_postreconfig(dns_catz_zones_t *catzs) {
isc_ht_iter_destroy(&iter); isc_ht_iter_destroy(&iter);
} }
isc_result_t void
dns_catz_get_iterator(dns_catz_zone_t *catz, isc_ht_iter_t **itp) { dns_catz_get_iterator(dns_catz_zone_t *catz, isc_ht_iter_t **itp) {
REQUIRE(DNS_CATZ_ZONE_VALID(catz)); REQUIRE(DNS_CATZ_ZONE_VALID(catz));
isc_ht_iter_create(catz->entries, itp);
return (ISC_R_SUCCESS); isc_ht_iter_create(catz->entries, itp);
} }

View File

@ -456,7 +456,7 @@ dns_catz_postreconfig(dns_catz_zones_t *catzs);
* \li 'catzs' is a valid dns_catz_zones_t. * \li 'catzs' is a valid dns_catz_zones_t.
*/ */
isc_result_t void
dns_catz_get_iterator(dns_catz_zone_t *catz, isc_ht_iter_t **itp); dns_catz_get_iterator(dns_catz_zone_t *catz, isc_ht_iter_t **itp);
/*%< /*%<
* Get the hashtable iterator on catalog zone members, point '*itp' to it. * Get the hashtable iterator on catalog zone members, point '*itp' to it.
@ -465,9 +465,6 @@ dns_catz_get_iterator(dns_catz_zone_t *catz, isc_ht_iter_t **itp);
* \li 'catzs' is a valid dns_catz_zones_t. * \li 'catzs' is a valid dns_catz_zones_t.
* \li 'itp' is not NULL and '*itp' is NULL. * \li 'itp' is not NULL and '*itp' is NULL.
* *
* Returns:
* \li #ISC_R_SUCCESS -- success
* \li Any other value -- failure
*/ */
ISC_LANG_ENDDECLS ISC_LANG_ENDDECLS