mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-13 20:33:15 +00:00
kill my_ptrace_child()
Now that my_ptrace_child() is trivial we can use the "p->ptrace & PT_PTRACED" inline and simplify the corresponding logic in do_wait: we can't find the child in TASK_TRACED state without PT_PTRACED flag set, ptrace_untrace() either sets TASK_STOPPED or wakes up the tracee. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Acked-by: Roland McGrath <roland@redhat.com> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
6b39c7bfbd
commit
34a1738f7d
@ -1511,12 +1511,6 @@ static int wait_task_continued(struct task_struct *p, int noreap,
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline int my_ptrace_child(struct task_struct *p)
|
|
||||||
{
|
|
||||||
return p->ptrace & PT_PTRACED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static long do_wait(pid_t pid, int options, struct siginfo __user *infop,
|
static long do_wait(pid_t pid, int options, struct siginfo __user *infop,
|
||||||
int __user *stat_addr, struct rusage __user *ru)
|
int __user *stat_addr, struct rusage __user *ru)
|
||||||
{
|
{
|
||||||
@ -1555,22 +1549,11 @@ repeat:
|
|||||||
/*
|
/*
|
||||||
* It's stopped now, so it might later
|
* It's stopped now, so it might later
|
||||||
* continue, exit, or stop again.
|
* continue, exit, or stop again.
|
||||||
*
|
|
||||||
* When we hit the race with PTRACE_ATTACH, we
|
|
||||||
* will not report this child. But the race
|
|
||||||
* means it has not yet been moved to our
|
|
||||||
* ptrace_children list, so we need to set the
|
|
||||||
* flag here to avoid a spurious ECHILD when
|
|
||||||
* the race happens with the only child.
|
|
||||||
*/
|
*/
|
||||||
flag = 1;
|
flag = 1;
|
||||||
|
if (!(p->ptrace & PT_PTRACED) &&
|
||||||
if (!my_ptrace_child(p)) {
|
!(options & WUNTRACED))
|
||||||
if (task_is_traced(p))
|
continue;
|
||||||
continue;
|
|
||||||
if (!(options & WUNTRACED))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
retval = wait_task_stopped(p, ret == 2,
|
retval = wait_task_stopped(p, ret == 2,
|
||||||
(options & WNOWAIT), infop,
|
(options & WNOWAIT), infop,
|
||||||
|
Loading…
Reference in New Issue
Block a user