From f28eb0a672a42ac6679c3d2da1104e6c8b18dbd6 Mon Sep 17 00:00:00 2001 From: Masamichi Takagi Date: Tue, 30 Sep 2014 15:59:38 +0900 Subject: [PATCH] Fix taking exit status when wait4()-ing stopped --- kernel/syscall.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/syscall.c b/kernel/syscall.c index 7bbc9b59..e4f49f77 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -327,9 +327,9 @@ static int wait_stopped(struct process *proc, struct fork_tree_node *child, int int ret; /* Copy exit_status created in do_signal */ - int *exit_status = (child->ptrace & PT_TRACED) ? - &child->exit_status : - &child->group_exit_status; + int *exit_status = child->status == PS_STOPPED ? + &child->group_exit_status : + &child->exit_status; /* Skip this process because exit_status has been reaped. */ if (!*exit_status) {