]> git.ipfire.org Git - zone-sync.git/commitdiff
main: Set error code on error
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 18 May 2026 16:04:40 +0000 (16:04 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 18 May 2026 16:04:40 +0000 (16:04 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
main.c

diff --git a/main.c b/main.c
index 07506d7b68cb04cd5b839542023bc586d326747f..873bb8b3cd13c76b8011b59e70c45b64a5999446 100644 (file)
--- 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;
        }