ptrace: cleanup check/set of PT_PTRACED during attach
authorOleg Nesterov <oleg@redhat.com>
Wed, 17 Jun 2009 23:27:32 +0000 (16:27 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 18 Jun 2009 20:03:51 +0000 (13:03 -0700)
commitf2f0b00ad61d53adfecb8bdf8f3cf8f05f6ed548
treedda08f8bb3e8c403b2d1cf941b17c9909975c209
parentb79b7ba93df14a1fc0b8d4d6d78a0e097de03bbd
ptrace: cleanup check/set of PT_PTRACED during attach

ptrace_attach() and ptrace_traceme() are the last functions which look as
if the untraced task can have task->ptrace != 0, this must not be
possible.  Change the code to just check ->ptrace != 0 and s/|=/=/ to set
PT_PTRACED.

Also, a couple of trivial whitespace cleanups in ptrace_attach().

And move ptrace_traceme() up near ptrace_attach() to keep them close to
each other.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Chris Wright <chrisw@sous-sol.org>
Acked-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/ptrace.c