Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84647
b: refs/heads/master
c: 34a1738
h: refs/heads/master
i:
  84645: 98432c9
  84643: db5a083
  84639: 7d3a65a
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Feb 8, 2008
1 parent 6b85106 commit 9bf711b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6b39c7bfbd1436836c0fb34c5b437fda1a7a3dd4
refs/heads/master: 34a1738f7da0b3d28d4b066d03a78f46b8cab68f
23 changes: 3 additions & 20 deletions trunk/kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1511,12 +1511,6 @@ static int wait_task_continued(struct task_struct *p, int noreap,
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,
int __user *stat_addr, struct rusage __user *ru)
{
Expand Down Expand Up @@ -1555,22 +1549,11 @@ static long do_wait(pid_t pid, int options, struct siginfo __user *infop,
/*
* It's stopped now, so it might later
* 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;

if (!my_ptrace_child(p)) {
if (task_is_traced(p))
continue;
if (!(options & WUNTRACED))
continue;
}
if (!(p->ptrace & PT_PTRACED) &&
!(options & WUNTRACED))
continue;

retval = wait_task_stopped(p, ret == 2,
(options & WNOWAIT), infop,
Expand Down

0 comments on commit 9bf711b

Please sign in to comment.