]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Drop single-use RETERR macro
authorMatthijs Mekking <matthijs@isc.org>
Mon, 9 Dec 2024 14:10:53 +0000 (15:10 +0100)
committerMatthijs Mekking <matthijs@isc.org>
Tue, 10 Dec 2024 08:46:22 +0000 (08:46 +0000)
If the RETERR define is only used once in a file, just drop the macro.

bin/named/zoneconf.c
lib/dns/nsec.c

index 483c06aff29863092a899a7b3181ad1f9ffd2cd7..0699fdb6b6ba00d0e39a888baca51c5ecd055caa 100644 (file)
@@ -61,13 +61,6 @@ typedef enum {
        allow_update_forwarding
 } acl_type_t;
 
-#define RETERR(x)                        \
-       do {                             \
-               isc_result_t _r = (x);   \
-               if (_r != ISC_R_SUCCESS) \
-                       return ((_r));   \
-       } while (0)
-
 #define CHECK(x)                             \
        do {                                 \
                result = (x);                \
@@ -577,9 +570,12 @@ configure_staticstub(const cfg_obj_t *zconfig, dns_zone_t *zone,
        isc_region_t region;
 
        /* Create the DB beforehand */
-       RETERR(dns_db_create(mctx, dbtype, dns_zone_getorigin(zone),
-                            dns_dbtype_stub, dns_zone_getclass(zone), 0, NULL,
-                            &db));
+       result = dns_db_create(mctx, dbtype, dns_zone_getorigin(zone),
+                              dns_dbtype_stub, dns_zone_getclass(zone), 0,
+                              NULL, &db);
+       if (result != ISC_R_SUCCESS) {
+               return result;
+       }
 
        dns_rdataset_init(&rdataset);
 
index 8e34772dca94ecdd4f068fb0dad4e5ca139a005e..255b9e9364454feeae0f86a79a1f13bfb25798e6 100644 (file)
 
 #include <dst/dst.h>
 
-#define RETERR(x)                            \
-       do {                                 \
-               result = (x);                \
-               if (result != ISC_R_SUCCESS) \
-                       goto failure;        \
-       } while (0)
-
 void
 dns_nsec_setbit(unsigned char *array, unsigned int type, unsigned int bit) {
        unsigned int shift, mask;
@@ -189,7 +182,10 @@ dns_nsec_build(dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node,
        dns_rdataset_init(&rdataset);
        dns_rdata_init(&rdata);
 
-       RETERR(dns_nsec_buildrdata(db, version, node, target, data, &rdata));
+       result = dns_nsec_buildrdata(db, version, node, target, data, &rdata);
+       if (result != ISC_R_SUCCESS) {
+               goto failure;
+       }
 
        dns_rdatalist_init(&rdatalist);
        rdatalist.rdclass = dns_db_class(db);