aboutsummaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/shell/ash.c b/shell/ash.c
index dcc73031f..f0480f723 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -4960,7 +4960,7 @@ waitpid_child(int *status, int wait_flags)
4960 HANDLE *proclist; 4960 HANDLE *proclist;
4961 pid_t pid = -1; 4961 pid_t pid = -1;
4962 DWORD win_status, idx; 4962 DWORD win_status, idx;
4963 int i, sig; 4963 int i;
4964 4964
4965 for (jb = curjob; jb; jb = jb->prev_job) { 4965 for (jb = curjob; jb; jb = jb->prev_job) {
4966 if (jb->state != JOBDONE) 4966 if (jb->state != JOBDONE)
@@ -4992,18 +4992,7 @@ waitpid_child(int *status, int wait_flags)
4992 wait_flags&WNOHANG ? 1 : INFINITE); 4992 wait_flags&WNOHANG ? 1 : INFINITE);
4993 if (idx < pid_nr) { 4993 if (idx < pid_nr) {
4994 GetExitCodeProcess(proclist[idx], &win_status); 4994 GetExitCodeProcess(proclist[idx], &win_status);
4995 if (win_status == 0xc0000005) 4995 *status = exit_code_to_wait_status(win_status);
4996 win_status = SIGSEGV << 24;
4997 else if (win_status == 0xc000013a)
4998 win_status = SIGINT << 24;
4999
5000 // When a process is terminated as if by a signal the exit
5001 // code is zero apart from the signal in its topmost byte.
5002 sig = win_status >> 24;
5003 if (sig != 0 && win_status == sig << 24 && is_valid_signal(sig))
5004 *status = sig;
5005 else
5006 *status = (int)win_status << 8;
5007 pid = pidlist[idx]; 4996 pid = pidlist[idx];
5008 } 4997 }
5009 done: 4998 done: