From: Michael Tremer Date: Mon, 18 May 2026 15:56:15 +0000 (+0000) Subject: main: Create a global error code that we can return X-Git-Tag: 0.0.1~20 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=ffa289be569a129627bffd54333943e5ead5e862;p=zone-sync.git main: Create a global error code that we can return Signed-off-by: Michael Tremer --- diff --git a/main.c b/main.c index 95c0755..d5baa5c 100644 --- a/main.c +++ b/main.c @@ -43,8 +43,12 @@ #define DEFAULT_PATH "/tmp" typedef struct ctx { + // Log Level int log_level; + // Return Code + int rc; + // Path const char* path; @@ -685,5 +689,11 @@ ERROR: if (ctx.zones) free(ctx.zones); - return r; + // Exit with our local return code if set + if (r) + return r; + + // Otherwise we use the global return code + // that could have been set in any of the callbacks. + return ctx.rc; }