From 26c9fb15e7df1ef1e2a6ed95c31ad4142f017bde Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 30 Oct 2005 15:02:50 -0800 Subject: [PATCH] --- yaml --- r: 11857 b: refs/heads/master c: 7f2a52555998c699a7e89f24636c909d6fc08a60 h: refs/heads/master i: 11855: 77fd29217990b793a292c57323103eb0249dbc44 v: v3 --- [refs] | 2 +- trunk/kernel/exit.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 62c4a253217b..e44620dbce94 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 396dc44bcac58f464b7b23c345052e37881cccea +refs/heads/master: 7f2a52555998c699a7e89f24636c909d6fc08a60 diff --git a/trunk/kernel/exit.c b/trunk/kernel/exit.c index 6ef8f7356a74..2d39ccc367e6 100644 --- a/trunk/kernel/exit.c +++ b/trunk/kernel/exit.c @@ -1383,6 +1383,15 @@ static long do_wait(pid_t pid, int options, struct siginfo __user *infop, switch (p->state) { case TASK_TRACED: + /* + * When we hit the race with PTRACE_ATTACH, + * we will not report this child. But the + * race means it has not yet been moved to + * our ptrace_children list, so we need to + * set the flag here to avoid a spurious ECHILD + * when the race happens with the only child. + */ + flag = 1; if (!my_ptrace_child(p)) continue; /*FALLTHROUGH*/