~emersion/mrsh

81ffb080ef3e1dae2f03d59432f895d28ac0066b — emersion 3 years ago 4f838e9
shell: use state->exit in subshell

Fixes #39
1 files changed, 3 insertions(+), 0 deletions(-)

M shell/task/subshell.c
M shell/task/subshell.c => shell/task/subshell.c +3 -0
@@ 32,6 32,9 @@ static bool task_subshell_start(struct task_subshell *ts, struct context *ctx) {
			exit(127);
		}

		if (ctx->state->exit >= 0) {
			exit(ctx->state->exit);
		}
		exit(ret);
	} else {
		process_init(&ts->process, pid);