]> 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 19:20:54 +0000 (20:20 +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.

(cherry picked from commit d128656d2e8a868b7c0c44e22a7410c9b39ddce8)

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

index 721464db8e9d48c2713dfbada6ad0c97fc9d2be8..e481e9f7c41cc5e8f4b55dda143e8eebe80ab6ba 100644 (file)
@@ -3046,13 +3046,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 a7aace20102dd2204aac9fa36098fe7d0810753f..d4237cdf038cbf40750e4298c56ef0550f0169f1 100644 (file)
@@ -2046,10 +2046,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 20c5f85fa3ff35c4d5ead4d16414cab956396a08..b288684b8ba4b1b44637ea762613b1c64bbd7f43 100644 (file)
@@ -457,7 +457,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.
@@ -466,9 +466,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