]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Cleanup the code to remove unnecessary indentation
authorAram Sargsyan <aram@isc.org>
Tue, 8 Feb 2022 12:01:51 +0000 (12:01 +0000)
committerAram Sargsyan <aram@isc.org>
Mon, 28 Mar 2022 10:17:56 +0000 (10:17 +0000)
Because of the "goto" in the "if" body the "else" part is unnecessary
and adds another level of indentation.

Cleanup the code to not have the "else" part.

bin/named/server.c

index 677efed0d3a9bd069ac96adba5a342be44e6d625..d6f74d3789de9acda88255496ffa026d7afeaa41 100644 (file)
@@ -2681,6 +2681,8 @@ catz_addmodzone_taskaction(isc_task_t *task, isc_event_t *event0) {
                             dns_catz_entry_getname(ev->entry), 0, NULL, &zone);
 
        if (ev->mod) {
+               dns_catz_zone_t *parentcatz;
+
                if (result != ISC_R_SUCCESS) {
                        isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
                                      NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
@@ -2688,46 +2690,40 @@ catz_addmodzone_taskaction(isc_task_t *task, isc_event_t *event0) {
                                      "modify zone \"%s\"",
                                      isc_result_totext(result), nameb);
                        goto cleanup;
-               } else {
-                       dns_catz_zone_t *parentcatz;
-
-                       if (!dns_zone_getadded(zone)) {
-                               isc_log_write(
-                                       named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
-                                       NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
-                                       "catz: "
-                                       "catz_addmodzone_taskaction: "
-                                       "zone '%s' is not a dynamically "
-                                       "added zone",
-                                       nameb);
-                               goto cleanup;
-                       }
+               }
 
-                       parentcatz = dns_zone_get_parentcatz(zone);
+               if (!dns_zone_getadded(zone)) {
+                       isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
+                                     NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
+                                     "catz: catz_addmodzone_taskaction: "
+                                     "zone '%s' is not a dynamically "
+                                     "added zone",
+                                     nameb);
+                       goto cleanup;
+               }
 
-                       if (parentcatz == NULL) {
-                               isc_log_write(
-                                       named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
-                                       NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
-                                       "catz: catz_addmodzone_taskaction: "
-                                       "zone '%s' exists and is not added by "
-                                       "a catalog zone, so won't be modified",
-                                       nameb);
-                               goto cleanup;
-                       }
-                       if (parentcatz != ev->origin) {
-                               isc_log_write(
-                                       named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
-                                       NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
-                                       "catz: catz_addmodzone_taskaction: "
-                                       "zone '%s' exists in multiple "
-                                       "catalog zones",
-                                       nameb);
-                               goto cleanup;
-                       }
+               parentcatz = dns_zone_get_parentcatz(zone);
 
-                       dns_zone_detach(&zone);
+               if (parentcatz == NULL) {
+                       isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
+                                     NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
+                                     "catz: catz_addmodzone_taskaction: "
+                                     "zone '%s' exists and is not added by "
+                                     "a catalog zone, so won't be modified",
+                                     nameb);
+                       goto cleanup;
                }
+               if (parentcatz != ev->origin) {
+                       isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
+                                     NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
+                                     "catz: catz_addmodzone_taskaction: "
+                                     "zone '%s' exists in multiple "
+                                     "catalog zones",
+                                     nameb);
+                       goto cleanup;
+               }
+
+               dns_zone_detach(&zone);
        } else {
                if (result == ISC_R_SUCCESS) {
                        isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,