diff options
| author | David Scholberg <recombinant.vector@gmail.com> | 2026-01-20 00:26:44 -0500 |
|---|---|---|
| committer | David Scholberg <recombinant.vector@gmail.com> | 2026-01-20 00:26:44 -0500 |
| commit | a543c00183e4315b50728b6073310bff944d8517 (patch) | |
| tree | 4275c957e5e8399a7d33b84f19a9f4f5a30729a7 | |
| parent | bdf22227d8b822b6ef8cdc4c0a62c37018bcc415 (diff) | |
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.
| -rw-r--r-- | src/main.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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(); |
