patch-2.0.34 linux/kernel/exit.c

Next file: linux/kernel/fork.c
Previous file: linux/ipc/shm.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.33/linux/kernel/exit.c linux/kernel/exit.c
@@ -660,9 +660,14 @@
 			if (p->pgrp != -pid)
 				continue;
 		}
-		/* wait for cloned processes iff the __WCLONE flag is set */
-		if ((p->exit_signal != SIGCHLD) ^ ((options & __WCLONE) != 0))
-			continue;
+		/* If you are tracing a process, then you don't need to get the
+		 * WCLONE bit right -- useful for strace and gdb
+		 */
+		if (!(p->flags & (PF_PTRACED|PF_TRACESYS))) {
+			/* wait for cloned processes iff the __WCLONE flag is set */
+			if ((p->exit_signal != SIGCHLD) ^ ((options & __WCLONE) != 0))
+				continue;
+		}
 		flag = 1;
 		switch (p->state) {
 			case TASK_STOPPED:

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov