]> git.ipfire.org Git - zone-sync.git/commitdiff
main: Correctly pass error code if the CLI parsing fails
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 11 May 2026 15:20:30 +0000 (15:20 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 11 May 2026 15:20:30 +0000 (15:20 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
main.c

diff --git a/main.c b/main.c
index 3aea732dc86224416666806655d32f603f6c0a6b..e7a97a6f3629a3f84cd3cee1097141961d82b6ce 100644 (file)
--- a/main.c
+++ b/main.c
@@ -556,7 +556,7 @@ int main(int argc, char* argv[]) {
        // Parse the command line
        r = argp_parse(&parser, argc, argv, ARGP_IN_ORDER, &arg_index, NULL);
        if (r)
-               return r;
+               goto ERROR;
 
        // Allocate a new memory context
        isc_mem_create(&ctx.memctx);
@@ -590,5 +590,5 @@ ERROR:
        if (ctx.zones)
                free(ctx.zones);
 
-       return 0;
+       return r;
 }