From 3154d91ded003170229670313ff6ded47bcf640e Mon Sep 17 00:00:00 2001 From: David Howells Date: Thu, 14 Mar 2002 21:20:04 -0800 Subject: [PATCH] wait4() WIFSTOPPED starvation fix #1/2 This patch (#1) just converts the task_struct to use struct list_head rather than direct pointers for maintaining the children list. --- kernel/fork.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'kernel/fork.c') diff --git a/kernel/fork.c b/kernel/fork.c index 2f3f7301236f..a05f52776e35 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -666,7 +666,8 @@ int do_fork(unsigned long clone_flags, unsigned long stack_start, INIT_LIST_HEAD(&p->run_list); - p->p_cptr = NULL; + INIT_LIST_HEAD(&p->children); + INIT_LIST_HEAD(&p->sibling); init_waitqueue_head(&p->wait_chldexit); p->vfork_done = NULL; if (clone_flags & CLONE_VFORK) { @@ -766,12 +767,12 @@ int do_fork(unsigned long clone_flags, unsigned long stack_start, write_lock_irq(&tasklist_lock); /* CLONE_PARENT re-uses the old parent */ - p->p_opptr = current->p_opptr; - p->p_pptr = current->p_pptr; + p->real_parent = current->real_parent; + p->parent = current->parent; if (!(clone_flags & CLONE_PARENT)) { - p->p_opptr = current; + p->real_parent = current; if (!(p->ptrace & PT_PTRACED)) - p->p_pptr = current; + p->parent = current; } if (clone_flags & CLONE_THREAD) { -- cgit v1.2.3