From: Aram Sargsyan Date: Tue, 8 Feb 2022 12:01:51 +0000 (+0000) Subject: Cleanup the code to remove unnecessary indentation X-Git-Tag: v9.19.0~42^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9b84bfb5f403945402194deca5a61016d6d02a4a;p=thirdparty%2Fbind9.git 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. --- diff --git a/bin/named/server.c b/bin/named/server.c index 677efed0d3a..d6f74d3789d 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 (!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,