patch-2.4.23 linux-2.4.23/arch/m68k/kernel/ptrace.c

Next file: linux-2.4.23/arch/m68k/math-emu/fp_emu.h
Previous file: linux-2.4.23/arch/m68k/defconfig
Back to the patch index
Back to the overall index

diff -urN linux-2.4.22/arch/m68k/kernel/ptrace.c linux-2.4.23/arch/m68k/kernel/ptrace.c
@@ -133,14 +133,9 @@
 		ret = ptrace_attach(child);
 		goto out_tsk;
 	}
-	ret = -ESRCH;
-	if (!(child->ptrace & PT_PTRACED))
-		goto out_tsk;
-	if (child->state != TASK_STOPPED) {
-		if (request != PTRACE_KILL)
-			goto out_tsk;
-	}
-	if (child->p_pptr != current)
+
+	ret = ptrace_check_attach(child, request == PTRACE_KILL);
+	if (ret < 0)
 		goto out_tsk;
 
 	switch (request) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)