aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlistair Francis <alistair.francis@wdc.com>2021-01-19 10:24:52 -0800
committerLaurent Vivier <laurent@vivier.eu>2021-02-13 22:50:49 +0100
commit1c3dfb506ea3decd17ec69ed6eaf611a885b9f59 (patch)
treeaae2504ce4259d1c86f92151fa4c41dfbe3c5bf4
parent0b72da03001c8c9f077fc019b9651c19a32c4600 (diff)
linux-user/signal: Decode waitid si_code
When mapping the host waitid status to the target status we previously just used decoding information in the status value. This doesn't follow what the waitid documentation describes, which instead suggests using the si_code value for the decoding. This results in the incorrect values seen when calling waitid. This is especially apparent on RV32 where all wait calls use waitid (see the bug case). This patch just passes the waitid status directly back to the guest. Buglink: https://bugs.launchpad.net/qemu/+bug/1906193 Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Tested-by: Andreas K. Hüttel <dilfridge@gentoo.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <1fb2d56aa23a81f4473e638abe9e2d78c09a3d5b.1611080607.git.alistair.francis@wdc.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
-rw-r--r--linux-user/signal.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 73de934c65..7eecec46c4 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -349,8 +349,7 @@ static inline void host_to_target_siginfo_noswap(target_siginfo_t *tinfo,
case TARGET_SIGCHLD:
tinfo->_sifields._sigchld._pid = info->si_pid;
tinfo->_sifields._sigchld._uid = info->si_uid;
- tinfo->_sifields._sigchld._status
- = host_to_target_waitstatus(info->si_status);
+ tinfo->_sifields._sigchld._status = info->si_status;
tinfo->_sifields._sigchld._utime = info->si_utime;
tinfo->_sifields._sigchld._stime = info->si_stime;
si_type = QEMU_SI_CHLD;