From a16c3170ef1248b388d4e41467ca004e3ab80e4d Mon Sep 17 00:00:00 2001 From: Masamichi Takagi Date: Thu, 4 Sep 2014 17:07:27 +0900 Subject: [PATCH] Correct wait4 when the child is not found Make wait4 return -ECHILD when pid is specified and it's not found. --- kernel/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/syscall.c b/kernel/syscall.c index f8a910be..b61c74a4 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -333,7 +333,7 @@ rescan: ihk_mc_spinlock_unlock_noirq(&child_iter->lock); } - if (empty) { + if (empty || (!child && pid != -1)) { ihk_mc_spinlock_unlock_noirq(&proc->ftn->lock); return -ECHILD; }