lkml.org 
[lkml]   [2007]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] wait_task_stopped: pass correct exit_code to wait_noreap_copyout
From
Date
In wait_task_stopped() exit_code already contains the right value for
the si_status member of siginfo, and this is simply set in the non
WNOWAIT case.

Pass it unchanged to wait_noreap_copyout(); we would only need to
shift it and add 0x7f if we were returning it in the user status field
and that isn't used for any function that permits WNOWAIT.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Roland McGrath <roland@redhat.com>

--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1389,7 +1389,7 @@ static int wait_task_stopped(struct task_struct
*p, int delayed_group_leader,
if (unlikely(!exit_code) || unlikely(p->exit_state))
goto bail_ref;
return wait_noreap_copyout(p, pid, uid,
- why, (exit_code << 8) | 0x7f,
+ why, exit_code,
infop, ru);
}

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2007-11-18 10:49    [W:0.050 / U:0.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site