]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Make dns_catz_get_iterator() return void
authorOndřej Surý <ondrej@isc.org>
Tue, 8 Mar 2022 10:30:37 +0000 (11:30 +0100)
committerOndřej Surý <ondrej@isc.org>
Tue, 8 Mar 2022 13:51:55 +0000 (14:51 +0100)
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.

bin/named/server.c
lib/dns/catz.c
lib/dns/include/dns/catz.h

index ec132117054d09b794c181f82f1043cac8651aca..2c5cc4253fa19de30ad0cb245effd55a2f983c25 100644 (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
                 * them to current view
                 */
-               result = 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;
-               }
+               dns_catz_get_iterator(zone, &it);
 
                for (result = isc_ht_iter_first(it); result == ISC_R_SUCCESS;
                     result = isc_ht_iter_next(it))
index 7a906e12cbe3d23e72f9d94b0acb45526dfa5302..393d8454a5df7082b6a4104ca5656cc964d8f0bc 100644 (file)
@@ -2025,10 +2025,9 @@ dns_catz_postreconfig(dns_catz_zones_t *catzs) {
        isc_ht_iter_destroy(&iter);
 }
 
-isc_result_t
+void
 dns_catz_get_iterator(dns_catz_zone_t *catz, isc_ht_iter_t **itp) {
        REQUIRE(DNS_CATZ_ZONE_VALID(catz));
-       isc_ht_iter_create(catz->entries, itp);
 
-       return (ISC_R_SUCCESS);
+       isc_ht_iter_create(catz->entries, itp);
 }
index 960520080b8031f5aa977fd468700411abde3538..78bdbde7a5625754e5f17a8d648d221fda2f4aa9 100644 (file)
@@ -456,7 +456,7 @@ dns_catz_postreconfig(dns_catz_zones_t *catzs);
  * \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);
 /*%<
  * 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 'itp' is not NULL and '*itp' is NULL.
  *
- * Returns:
- * \li #ISC_R_SUCCESS          -- success
- * \li Any other value         -- failure
  */
 
 ISC_LANG_ENDDECLS