Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256853
b: refs/heads/master
c: 9843a1e
h: refs/heads/master
i:
  256851: e65783b
v: v3
  • Loading branch information
Oleg Nesterov committed Jun 27, 2011
1 parent 0c77ef9 commit 75b2516
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 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: 45cdf5cc0703c537194588c63d53bad1f2539d36
refs/heads/master: 9843a1e977977986d0a4c1000f2229b032572534
33 changes: 18 additions & 15 deletions trunk/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,25 +370,28 @@ static int ignoring_children(struct sighand_struct *sigh)
*/
static bool __ptrace_detach(struct task_struct *tracer, struct task_struct *p)
{
bool dead;

__ptrace_unlink(p);

if (p->exit_state == EXIT_ZOMBIE) {
if (!task_detached(p) && thread_group_empty(p)) {
if (!same_thread_group(p->real_parent, tracer))
do_notify_parent(p, p->exit_signal);
else if (ignoring_children(tracer->sighand)) {
__wake_up_parent(p, tracer);
p->exit_signal = -1;
}
}
if (task_detached(p)) {
/* Mark it as in the process of being reaped. */
p->exit_state = EXIT_DEAD;
return true;
if (p->exit_state != EXIT_ZOMBIE)
return false;

dead = !thread_group_leader(p);

if (!dead && thread_group_empty(p)) {
if (!same_thread_group(p->real_parent, tracer))
dead = do_notify_parent(p, p->exit_signal);
else if (ignoring_children(tracer->sighand)) {
__wake_up_parent(p, tracer);
p->exit_signal = -1;
dead = true;
}
}

return false;
/* Mark it as in the process of being reaped. */
if (dead)
p->exit_state = EXIT_DEAD;
return dead;
}

static int ptrace_detach(struct task_struct *child, unsigned int data)
Expand Down

0 comments on commit 75b2516

Please sign in to comment.