From a543c00183e4315b50728b6073310bff944d8517 Mon Sep 17 00:00:00 2001 From: David Scholberg Date: Tue, 20 Jan 2026 00:26:44 -0500 Subject: propagate return code when using zc `run` subcommand on POSIX On POSIX systems, the return value of the system function from stdlib is a packed value, and requires the WEXITSTATUS macro to unpack the return code of the program that the system function ran. --- src/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.c b/src/main.c index 44cf45d..6fa8809 100644 --- a/src/main.c +++ b/src/main.c @@ -356,7 +356,11 @@ int main(int argc, char **argv) remove(outfile); zptr_plugin_mgr_cleanup(); zen_trigger_global(); +#if defined(WIFEXITED) && defined(WEXITSTATUS) + return WIFEXITED(ret) ? WEXITSTATUS(ret) : ret; +#else return ret; +#endif } zptr_plugin_mgr_cleanup(); -- cgit v1.2.3