Author | Jamozed <[email protected]> |
Date | 2021-09-11 12:23:20 |
Commit | e87cff2c49d576d80632ce27aadd1c3c686e5e17 |
Parent | 65268ba9dedd4750877dde27b6311f2a2411a070 |
Fix exit status handling
Diffstat
M | src/eval.c | | | 2 | +- |
M | src/exec.c | | | 2 | +- |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/eval.c b/src/eval.c index eadaca0..991aac3 100644 --- a/src/eval.c +++ b/src/eval.c @@ -47,7 +47,7 @@ extern void eval(u8 *src, UINT len) { ast a = parse(&l); if (!a) { goto ret; } if (Pflag) { ast_debug(a); goto ret; } - _ret = WEXITSTATUS(execute(a)); + _ret = execute(a); ret:; ast_free(a); diff --git a/src/exec.c b/src/exec.c index bfea0ce..1b58935 100644 --- a/src/exec.c +++ b/src/exec.c @@ -79,7 +79,7 @@ static int execute_comm(ast a) { } } - return launch((u8 **)a->c->data); + return WEXITSTATUS(launch((u8 **)a->c->data)); } /* Fork and execute an executable. */