From 9f84c65e766cfb3ddda1979dee70c87616325231 Mon Sep 17 00:00:00 2001 From: KO Myung-Hun Date: Wed, 21 Dec 2016 20:02:56 +0900 Subject: [PATCH] os2: return an error code correctly when a child was signaled For example, a child process terminates due to abort(). modified: os2.c --- os2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/os2.c b/os2.c index be65247..9356023 100644 --- a/os2.c +++ b/os2.c @@ -478,6 +478,9 @@ int execve(const char *name, char * const *argv, char * const *envp) if (rc == -1) return -1; + if (WIFSIGNALED(status)) + _exit(ksh_sigmask(WTERMSIG(status))); + _exit(WEXITSTATUS(status)); }