From: Michael Tremer Date: Mon, 18 May 2026 16:04:40 +0000 (+0000) Subject: main: Set error code on error X-Git-Tag: 0.0.1~18 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=e5b607581482864eb02c57203ca174095d2184c0;p=zone-sync.git main: Set error code on error Signed-off-by: Michael Tremer --- diff --git a/main.c b/main.c index 07506d7..873bb8b 100644 --- a/main.c +++ b/main.c @@ -245,6 +245,7 @@ static void transfer_done(dns_zone_t* zone, uint32_t* expireopt, isc_result_t re r = dns_zone_flush(zone); if (r) { ERROR("%s: Failed to flush zone\n", name); + ctx.rc = 1; } break; @@ -254,6 +255,7 @@ static void transfer_done(dns_zone_t* zone, uint32_t* expireopt, isc_result_t re default: ERROR("%s: Zone transfer failed\n", name); + ctx.rc = 1; break; } @@ -291,6 +293,7 @@ static int do_transfer(dns_zone_t* zone, uint32_t serial) { default: ERROR("Failed to initialize zone transfer: %s\n", isc_result_totext(r)); + ctx.rc = 1; goto ERROR; } @@ -370,6 +373,7 @@ static void do_zone(const char* name) { r = dns_zonemgr_managezone(ctx.zonemgr, zone); if (r) { ERROR("Failed to add the zone to the zone manager: %s\n", isc_result_totext(r)); + ctx.rc = 1; goto ERROR; } @@ -377,6 +381,7 @@ static void do_zone(const char* name) { r = dns_zone_setorigin(zone, origin); if (r) { ERROR("Failed to set the zone's origin\n"); + ctx.rc = 1; goto ERROR; } @@ -390,6 +395,7 @@ static void do_zone(const char* name) { r = dns_zone_setfile(zone, path, dns_masterformat_text, &dns_master_style_default); if (r) { ERROR("Failed to set the zone's filename %s: %m\n", path); + ctx.rc = 1; goto ERROR; } @@ -397,6 +403,7 @@ static void do_zone(const char* name) { r = dns_zone_setjournal(zone, journal_path); if (r) { ERROR("Failed to set the zone's journal path: %s\n", isc_result_totext(r)); + ctx.rc = 1; goto ERROR; } @@ -411,6 +418,7 @@ static void do_zone(const char* name) { default: ERROR("Failed to load zone: %s\n", isc_result_totext(r)); + ctx.rc = 1; goto ERROR; }