From: Matthijs Mekking Date: Thu, 19 Mar 2026 15:23:59 +0000 (+0100) Subject: Return void in functions that cannot fail X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93376b8f67ddbc2d4b28301558ad34332af9a7ad;p=thirdparty%2Fbind9.git Return void in functions that cannot fail dns_zone_getloadtime(), dns_zone_getexpiretime(), dns_zone_getrefreshtime(), and dns_zone_getrefreshkeytime() cannot fail, so return void instead of ISC_R_SUCCESS. --- diff --git a/bin/named/statschannel.c b/bin/named/statschannel.c index 1419d646321..87b708b5e34 100644 --- a/bin/named/statschannel.c +++ b/bin/named/statschannel.c @@ -1442,7 +1442,7 @@ zone_xmlrender(dns_zone_t *zone, void *arg) { * primary zones, only include the loaded time. For secondary zones, * also include the expire and refresh times. */ - CHECK(dns_zone_getloadtime(zone, ×tamp)); + dns_zone_getloadtime(zone, ×tamp); isc_time_formatISO8601(×tamp, buf, 64); TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "loaded")); @@ -1450,13 +1450,13 @@ zone_xmlrender(dns_zone_t *zone, void *arg) { TRY0(xmlTextWriterEndElement(writer)); if (dns_zone_gettype(zone) == dns_zone_secondary) { - CHECK(dns_zone_getexpiretime(zone, ×tamp)); + dns_zone_getexpiretime(zone, ×tamp); isc_time_formatISO8601(×tamp, buf, 64); TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "expires")); TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR buf)); TRY0(xmlTextWriterEndElement(writer)); - CHECK(dns_zone_getrefreshtime(zone, ×tamp)); + dns_zone_getrefreshtime(zone, ×tamp); isc_time_formatISO8601(×tamp, buf, 64); TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "refresh")); TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR buf)); @@ -2530,18 +2530,18 @@ zone_jsonrender(dns_zone_t *zone, void *arg) { * zones, also include the expire and refresh times. */ - CHECK(dns_zone_getloadtime(zone, ×tamp)); + dns_zone_getloadtime(zone, ×tamp); isc_time_formatISO8601(×tamp, buf, 64); json_object_object_add(zoneobj, "loaded", json_object_new_string(buf)); if (dns_zone_gettype(zone) == dns_zone_secondary) { - CHECK(dns_zone_getexpiretime(zone, ×tamp)); + dns_zone_getexpiretime(zone, ×tamp); isc_time_formatISO8601(×tamp, buf, 64); json_object_object_add(zoneobj, "expires", json_object_new_string(buf)); - CHECK(dns_zone_getrefreshtime(zone, ×tamp)); + dns_zone_getrefreshtime(zone, ×tamp); isc_time_formatISO8601(×tamp, buf, 64); json_object_object_add(zoneobj, "refresh", json_object_new_string(buf)); diff --git a/lib/dns/include/dns/zoneproperties.h b/lib/dns/include/dns/zoneproperties.h index 48f3ff02023..a4924532713 100644 --- a/lib/dns/include/dns/zoneproperties.h +++ b/lib/dns/include/dns/zoneproperties.h @@ -1411,25 +1411,25 @@ dns_zone_getserialupdatemethod(dns_zone_t *zone); * \li 'zone' to be valid. */ -isc_result_t +void dns_zone_getloadtime(dns_zone_t *zone, isc_time_t *loadtime); /*% * Return the time when the zone was last loaded. */ -isc_result_t +void dns_zone_getrefreshtime(dns_zone_t *zone, isc_time_t *refreshtime); /*% * Return the time when the (secondary) zone will need to be refreshed. */ -isc_result_t +void dns_zone_getexpiretime(dns_zone_t *zone, isc_time_t *expiretime); /*% * Return the time when the (secondary) zone will expire. */ -isc_result_t +void dns_zone_getrefreshkeytime(dns_zone_t *zone, isc_time_t *refreshkeytime); /*% * Return the time of the next scheduled DNSSEC key event. diff --git a/lib/dns/zoneproperties.c b/lib/dns/zoneproperties.c index fa5ce1ef137..fc323068f85 100644 --- a/lib/dns/zoneproperties.c +++ b/lib/dns/zoneproperties.c @@ -1907,7 +1907,7 @@ dns_zone_getserialupdatemethod(dns_zone_t *zone) { return zone->updatemethod; } -isc_result_t +void dns_zone_getloadtime(dns_zone_t *zone, isc_time_t *loadtime) { REQUIRE(DNS_ZONE_VALID(zone)); REQUIRE(loadtime != NULL); @@ -1915,10 +1915,9 @@ dns_zone_getloadtime(dns_zone_t *zone, isc_time_t *loadtime) { LOCK_ZONE(zone); *loadtime = zone->loadtime; UNLOCK_ZONE(zone); - return ISC_R_SUCCESS; } -isc_result_t +void dns_zone_getexpiretime(dns_zone_t *zone, isc_time_t *expiretime) { REQUIRE(DNS_ZONE_VALID(zone)); REQUIRE(expiretime != NULL); @@ -1926,10 +1925,9 @@ dns_zone_getexpiretime(dns_zone_t *zone, isc_time_t *expiretime) { LOCK_ZONE(zone); *expiretime = zone->expiretime; UNLOCK_ZONE(zone); - return ISC_R_SUCCESS; } -isc_result_t +void dns_zone_getrefreshtime(dns_zone_t *zone, isc_time_t *refreshtime) { REQUIRE(DNS_ZONE_VALID(zone)); REQUIRE(refreshtime != NULL); @@ -1937,10 +1935,9 @@ dns_zone_getrefreshtime(dns_zone_t *zone, isc_time_t *refreshtime) { LOCK_ZONE(zone); *refreshtime = zone->refreshtime; UNLOCK_ZONE(zone); - return ISC_R_SUCCESS; } -isc_result_t +void dns_zone_getrefreshkeytime(dns_zone_t *zone, isc_time_t *refreshkeytime) { REQUIRE(DNS_ZONE_VALID(zone)); REQUIRE(refreshkeytime != NULL); @@ -1948,7 +1945,6 @@ dns_zone_getrefreshkeytime(dns_zone_t *zone, isc_time_t *refreshkeytime) { LOCK_ZONE(zone); *refreshkeytime = zone->refreshkeytime; UNLOCK_ZONE(zone); - return ISC_R_SUCCESS; } void