diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2015-07-18 09:02:50 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2015-07-18 09:02:50 +0000 |
commit | b4490c6e937e404832d1169ca7dbac3b2e712355 (patch) | |
tree | 5d1411f5124df7d1ff8fb76e514e51a232fa0406 /sys/compat/svr4 | |
parent | ddee45244d118e34a2ad7510a7864c52840e9767 (diff) | |
download | src-b4490c6e937e404832d1169ca7dbac3b2e712355.tar.gz src-b4490c6e937e404832d1169ca7dbac3b2e712355.zip |
The si_status field of the siginfo_t, provided by the waitid(2) and
SIGCHLD signal, should keep full 32 bits of the status passed to the
_exit(2).
Split the combined p_xstat of the struct proc into the separate exit
status p_xexit for normal process exit, and signalled termination
information p_xsig. Kernel-visible macro KW_EXITCODE() reconstructs
old p_xstat from p_xexit and p_xsig. p_xexit contains complete status
and copied out into si_status.
Requested by: Joerg Schilling
Reviewed by: jilles (previous version), pho
Tested by: pho
Sponsored by: The FreeBSD Foundation
Notes
Notes:
svn path=/head/; revision=285670
Diffstat (limited to 'sys/compat/svr4')
-rw-r--r-- | sys/compat/svr4/svr4_misc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index 5e5387481d72..b560764ca8e2 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -1277,7 +1277,7 @@ loop: /* Found a zombie, so cache info in local variables. */ pid = p->p_pid; - status = p->p_xstat; + status = KW_EXITCODE(p->p_xexit, p->p_xsig); ru = p->p_ru; PROC_STATLOCK(p); calcru(p, &ru.ru_utime, &ru.ru_stime); @@ -1304,7 +1304,7 @@ loop: p->p_flag |= P_WAITED; sx_sunlock(&proctree_lock); pid = p->p_pid; - status = W_STOPCODE(p->p_xstat); + status = W_STOPCODE(p->p_xsig); ru = p->p_ru; PROC_STATLOCK(p); calcru(p, &ru.ru_utime, &ru.ru_stime); |