fix ptrace02 failed

This commit is contained in:
Tomoki Shirasawa
2015-10-30 16:59:03 +09:00
parent 9e3b0b5866
commit e9458a6cd3

View File

@ -414,12 +414,14 @@ do_wait(int pid, int *status, int options, void *rusage)
if((child->ptrace & PT_TRACED) && if((child->ptrace & PT_TRACED) &&
(child->status & (PS_STOPPED | PS_TRACED))) { (child->status & (PS_STOPPED | PS_TRACED))) {
ret = wait_stopped(thread, child, status, options); ret = wait_stopped(thread, child, status, options);
if(ret == child->pid){
if(!(options & WNOWAIT)){ if(!(options & WNOWAIT)){
child->signal_flags &= ~SIGNAL_STOP_STOPPED; child->signal_flags &= ~SIGNAL_STOP_STOPPED;
} }
mcs_rwlock_writer_unlock_noirq(&thread->proc->children_lock, &lock); mcs_rwlock_writer_unlock_noirq(&thread->proc->children_lock, &lock);
goto out_found; goto out_found;
} }
}
if((child->signal_flags & SIGNAL_STOP_CONTINUED) && if((child->signal_flags & SIGNAL_STOP_CONTINUED) &&
(options & WCONTINUED)) { (options & WCONTINUED)) {