summaryrefslogtreecommitdiffstats
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
authorMiloš Stojanović2017-05-15 16:59:43 +0200
committerRiku Voipio2017-05-29 13:56:08 +0200
commita8617d8c2fa888a37ecb7db6635fb44964505277 (patch)
tree424970cc793b9b4ebf0595c2b06e81d98ab9a44d /linux-user/syscall.c
parentlinux-user: add tkill(), tgkill() and rt_sigqueueinfo() strace (diff)
downloadqemu-a8617d8c2fa888a37ecb7db6635fb44964505277.tar.gz
qemu-a8617d8c2fa888a37ecb7db6635fb44964505277.tar.xz
qemu-a8617d8c2fa888a37ecb7db6635fb44964505277.zip
linux-user: fix ssetmask() system call
Fix the ssetmask() system call by removing the invocation of sigorset(). The ssetmask() system call should replace the old signal mask with the new and return the old mask. It shouldn't combine the old and the new mask with sigorset(). Fetching the old mask for sigorset() is also no longer needed. The problem was detected after running LTP test group syscalls for the MIPS EL 32 R2 architecture where the test ssetmask01 failed with exit code 1. The test passes now that the ssetmask() system call is fixed. Signed-off-by: Miloš Stojanović <Milos.Stojanovic@rt-rk.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r--linux-user/syscall.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 909dde6de6..93bc6f679e 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8621,17 +8621,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
#ifdef TARGET_NR_ssetmask /* not on alpha */
case TARGET_NR_ssetmask:
{
- sigset_t set, oset, cur_set;
+ sigset_t set, oset;
abi_ulong target_set = arg1;
- /* We only have one word of the new mask so we must read
- * the rest of it with do_sigprocmask() and OR in this word.
- * We are guaranteed that a do_sigprocmask() that only queries
- * the signal mask will not fail.
- */
- ret = do_sigprocmask(0, NULL, &cur_set);
- assert(!ret);
target_to_host_old_sigset(&set, &target_set);
- sigorset(&set, &set, &cur_set);
ret = do_sigprocmask(SIG_SETMASK, &set, &oset);
if (!ret) {
host_to_target_old_sigset(&target_set, &oset);