diff options
author | Oleg Nesterov <oleg@redhat.com> | 2009-06-17 16:27:30 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-18 13:03:51 -0700 |
commit | 5cb11446892833e50970fb2277a9f7563b0a8bd3 (patch) | |
tree | 9cb858cb093c4b927601ef8a612d8dd791aeb1c8 /kernel/exit.c | |
parent | 1c216279539bd65c5a3d497e25d441dbddbcf1ec (diff) | |
download | linux-5cb11446892833e50970fb2277a9f7563b0a8bd3.tar.bz2 |
ptrace: do not use task->ptrace directly in core kernel
No functional changes.
- Nobody except ptrace.c & co should use ptrace flags directly, we have
task_ptrace() for that.
- No need to specially check PT_PTRACED, we must not have other PT_ bits
set without PT_PTRACED. And no need to know this flag exists.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 213f906f5e16..938cceebb9ad 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -757,7 +757,7 @@ static void reparent_thread(struct task_struct *father, struct task_struct *p, p->exit_signal = SIGCHLD; /* If it has exited notify the new parent about this child's death. */ - if (!p->ptrace && + if (!task_ptrace(p) && p->exit_state == EXIT_ZOMBIE && thread_group_empty(p)) { do_notify_parent(p, p->exit_signal); if (task_detached(p)) { @@ -782,7 +782,7 @@ static void forget_original_parent(struct task_struct *father) list_for_each_entry_safe(p, n, &father->children, sibling) { p->real_parent = reaper; if (p->parent == father) { - BUG_ON(p->ptrace); + BUG_ON(task_ptrace(p)); p->parent = p->real_parent; } reparent_thread(father, p, &dead_children); @@ -1482,7 +1482,7 @@ static int wait_consider_task(struct task_struct *parent, int ptrace, return 0; } - if (likely(!ptrace) && unlikely(p->ptrace)) { + if (likely(!ptrace) && unlikely(task_ptrace(p))) { /* * This child is hidden by ptrace. * We aren't allowed to see it now, but eventually we will. |