aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-10-01 14:04:18 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-01 14:04:18 -0400
commit14bf01bb0599c89fc7f426d20353b76e12555308 (patch)
tree4d9c164faaff5df25044b15afa235debc96091dc /kernel
parentfd2e54b35bd70d11c160ded4834e2378e915356e (diff)
Fix inequality comparison against "task->state"
We should always use bitmask ops, rather than depend on some ordering of the different states. With the TASK_NONINTERACTIVE flag, the inequality doesn't really work. Oleg Nesterov argues (likely correctly) that this test is unnecessary in the first place. However, the minimal fix for now is to at least make it work in the presense of TASK_NONINTERACTIVE. Waiting for consensus from Roland & co on potential bigger cleanups. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/exit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index ee6d8b8abef5..43077732619b 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1203,7 +1203,7 @@ static int wait_task_stopped(task_t *p, int delayed_group_leader, int noreap,
1203 1203
1204 exit_code = p->exit_code; 1204 exit_code = p->exit_code;
1205 if (unlikely(!exit_code) || 1205 if (unlikely(!exit_code) ||
1206 unlikely(p->state > TASK_STOPPED)) 1206 unlikely(p->state & TASK_TRACED))
1207 goto bail_ref; 1207 goto bail_ref;
1208 return wait_noreap_copyout(p, pid, uid, 1208 return wait_noreap_copyout(p, pid, uid,
1209 why, (exit_code << 8) | 0x7f, 1209 why, (exit_code << 8) | 0x7f,