From 9b84bfb5f403945402194deca5a61016d6d02a4a Mon Sep 17 00:00:00 2001 From: Aram Sargsyan Date: Tue, 8 Feb 2022 12:01:51 +0000 Subject: [PATCH] Cleanup the code to remove unnecessary indentation 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 | 74 ++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 39 deletions(-) diff --git a/bin/named/server.c b/bin/named/server.c index 677efed0d3..d6f74d3789 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -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 (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); } + + 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 (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,