Skip to content

Commit

Permalink
ptrace: __ptrace_unlink: use the ptrace_reparented() helper
Browse files Browse the repository at this point in the history
Currently __ptrace_unlink() checks list_empty(->ptrace_list) to figure out
whether the child was reparented.  Change the code to use ptrace_reparented()
to make this check more explicit and consistent.

No functional changes.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
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>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Apr 30, 2008
1 parent 53b6f9f commit 68cb947
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void __ptrace_unlink(struct task_struct *child)
BUG_ON(!child->ptrace);

child->ptrace = 0;
if (!list_empty(&child->ptrace_list)) {
if (ptrace_reparented(child)) {
list_del_init(&child->ptrace_list);
remove_parent(child);
child->parent = child->real_parent;
Expand Down

0 comments on commit 68cb947

Please sign in to comment.