aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 29622e468b7f..9c6881a0a8b4 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1576,27 +1576,22 @@ repeat:
1576 * might later match our criteria, even if we are not able to reap 1576 * might later match our criteria, even if we are not able to reap
1577 * it yet. 1577 * it yet.
1578 */ 1578 */
1579 retval = wo->notask_error = -ECHILD; 1579 wo->notask_error = -ECHILD;
1580 if ((wo->wo_type < PIDTYPE_MAX) && 1580 if ((wo->wo_type < PIDTYPE_MAX) &&
1581 (!wo->wo_pid || hlist_empty(&wo->wo_pid->tasks[wo->wo_type]))) 1581 (!wo->wo_pid || hlist_empty(&wo->wo_pid->tasks[wo->wo_type])))
1582 goto end; 1582 goto notask;
1583 1583
1584 current->state = TASK_INTERRUPTIBLE; 1584 current->state = TASK_INTERRUPTIBLE;
1585 read_lock(&tasklist_lock); 1585 read_lock(&tasklist_lock);
1586 tsk = current; 1586 tsk = current;
1587 do { 1587 do {
1588 int tsk_result = do_wait_thread(wo, tsk); 1588 retval = do_wait_thread(wo, tsk);
1589 1589 if (retval)
1590 if (!tsk_result) 1590 goto end;
1591 tsk_result = ptrace_do_wait(wo, tsk);
1592 1591
1593 if (tsk_result) { 1592 retval = ptrace_do_wait(wo, tsk);
1594 /* 1593 if (retval)
1595 * tasklist_lock is unlocked and we have a final result.
1596 */
1597 retval = tsk_result;
1598 goto end; 1594 goto end;
1599 }
1600 1595
1601 if (wo->wo_flags & __WNOTHREAD) 1596 if (wo->wo_flags & __WNOTHREAD)
1602 break; 1597 break;
@@ -1605,6 +1600,7 @@ repeat:
1605 } while (tsk != current); 1600 } while (tsk != current);
1606 read_unlock(&tasklist_lock); 1601 read_unlock(&tasklist_lock);
1607 1602
1603notask:
1608 retval = wo->notask_error; 1604 retval = wo->notask_error;
1609 if (!retval && !(wo->wo_flags & WNOHANG)) { 1605 if (!retval && !(wo->wo_flags & WNOHANG)) {
1610 retval = -ERESTARTSYS; 1606 retval = -ERESTARTSYS;