From e9458a6cd35243543ef899f86c16a86ec25e108c Mon Sep 17 00:00:00 2001 From: Tomoki Shirasawa Date: Fri, 30 Oct 2015 16:59:03 +0900 Subject: [PATCH] fix ptrace02 failed --- kernel/syscall.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kernel/syscall.c b/kernel/syscall.c index 741c637c..bc3066c7 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -414,11 +414,13 @@ do_wait(int pid, int *status, int options, void *rusage) if((child->ptrace & PT_TRACED) && (child->status & (PS_STOPPED | PS_TRACED))) { ret = wait_stopped(thread, child, status, options); - if(!(options & WNOWAIT)){ - child->signal_flags &= ~SIGNAL_STOP_STOPPED; + if(ret == child->pid){ + if(!(options & WNOWAIT)){ + child->signal_flags &= ~SIGNAL_STOP_STOPPED; + } + mcs_rwlock_writer_unlock_noirq(&thread->proc->children_lock, &lock); + goto out_found; } - mcs_rwlock_writer_unlock_noirq(&thread->proc->children_lock, &lock); - goto out_found; } if((child->signal_flags & SIGNAL_STOP_CONTINUED) &&