From 959df5d6cedf1c02ad35b2a84343aa282b98329c Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Fri, 8 Feb 2008 04:19:02 -0800 Subject: [PATCH] --- yaml --- r: 84651 b: refs/heads/master c: 9cbab8100538efdd93aeae6fc37787d986f2f558 h: refs/heads/master i: 84649: 2023f2b109504aeadb902e5a077e58776c6f67ec 84647: 9bf711bfb469185a3a9588390e0182cfa329b84d v: v3 --- [refs] | 2 +- trunk/kernel/exit.c | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index b3ae34c4ba59..c09838e508e4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ee7c82da830ea860b1f9274f1f0cdf99f206e7c2 +refs/heads/master: 9cbab8100538efdd93aeae6fc37787d986f2f558 diff --git a/trunk/kernel/exit.c b/trunk/kernel/exit.c index da293ac7e379..723a69b69fa1 100644 --- a/trunk/kernel/exit.c +++ b/trunk/kernel/exit.c @@ -1511,6 +1511,7 @@ static long do_wait(pid_t pid, int options, struct siginfo __user *infop, } allowed = 1; + retval = 0; if (task_is_stopped_or_traced(p)) { /* * It's stopped now, so it might later @@ -1524,8 +1525,6 @@ static long do_wait(pid_t pid, int options, struct siginfo __user *infop, retval = wait_task_stopped(p, ret == 2, (options & WNOWAIT), infop, stat_addr, ru); - if (retval != 0) /* He released the lock. */ - goto end; } else if (p->exit_state == EXIT_ZOMBIE) { /* * Eligible but we cannot release it yet: @@ -1537,9 +1536,6 @@ static long do_wait(pid_t pid, int options, struct siginfo __user *infop, retval = wait_task_zombie(p, (options & WNOWAIT), infop, stat_addr, ru); - /* He released the lock. */ - if (retval != 0) - goto end; } else if (p->exit_state != EXIT_DEAD) { check_continued: /* @@ -1552,9 +1548,9 @@ static long do_wait(pid_t pid, int options, struct siginfo __user *infop, retval = wait_task_continued(p, (options & WNOWAIT), infop, stat_addr, ru); - if (retval != 0) /* He released the lock. */ - goto end; } + if (retval != 0) /* tasklist_lock released */ + goto end; } if (!flag) { list_for_each_entry(p, &tsk->ptrace_children, @@ -1590,7 +1586,7 @@ static long do_wait(pid_t pid, int options, struct siginfo __user *infop, remove_wait_queue(¤t->signal->wait_chldexit,&wait); if (infop) { if (retval > 0) - retval = 0; + retval = 0; else { /* * For a WNOHANG return, clear out all the fields