From 397bf3f4a6fdddf4eb667ea3576cbcb94841e170 Mon Sep 17 00:00:00 2001 From: Tomoki Shirasawa Date: Thu, 21 Apr 2016 20:28:36 +0900 Subject: [PATCH] wait_zombie: don't wait attached process refs #726 --- kernel/syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/syscall.c b/kernel/syscall.c index a0c8db47..748850dc 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -294,8 +294,8 @@ static int wait_zombie(struct thread *thread, struct process *child, int *status } ppid = child->ppid_parent->pid; - if(ppid == 1 || child->nowait) - return 0; + if(child->ppid_parent->pid != thread->proc->pid || child->nowait) + return child->pid; request.number = __NR_wait4; request.args[0] = child->pid; request.args[1] = 0;