os2: return an error code correctly when a child was signaled

For example, a child process terminates due to abort().

    modified:   os2.c
This commit is contained in:
KO Myung-Hun 2016-12-21 20:02:56 +09:00
parent 89d461dd83
commit 9f84c65e76

3
os2.c
View File

@ -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));
}