Fix taking exit status when wait4()-ing stopped

This commit is contained in:
Masamichi Takagi
2014-09-30 15:59:38 +09:00
committed by Tomoki Shirasawa
parent 95dd193fd6
commit f28eb0a672

View File

@@ -327,9 +327,9 @@ static int wait_stopped(struct process *proc, struct fork_tree_node *child, int
int ret; int ret;
/* Copy exit_status created in do_signal */ /* Copy exit_status created in do_signal */
int *exit_status = (child->ptrace & PT_TRACED) ? int *exit_status = child->status == PS_STOPPED ?
&child->exit_status : &child->group_exit_status :
&child->group_exit_status; &child->exit_status;
/* Skip this process because exit_status has been reaped. */ /* Skip this process because exit_status has been reaped. */
if (!*exit_status) { if (!*exit_status) {