public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Scott James Remnant <scott@ubuntu.com>
To: linux-kernel@vger.kernel.org
Cc: Oleg Nesterov <oleg@tv-sign.ru>, Roland McGrath <roland@redhat.com>
Subject: [PATCH] wait_task_stopped: pass correct exit_code to wait_noreap_copyout
Date: Sun, 18 Nov 2007 09:13:24 +0000	[thread overview]
Message-ID: <1195377204.6070.3.camel@wing-commander> (raw)

[-- Attachment #1: Type: text/plain, Size: 885 bytes --]

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);
 	}
 


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2007-11-18  9:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-18  9:13 Scott James Remnant [this message]
2007-11-20  6:43 ` [PATCH] wait_task_stopped: pass correct exit_code to wait_noreap_copyout Andrew Morton
2007-11-20  7:55   ` Scott James Remnant
2007-11-20  8:16     ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1195377204.6070.3.camel@wing-commander \
    --to=scott@ubuntu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@tv-sign.ru \
    --cc=roland@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox