qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 6/8] linux-user: translate signal number on return f


From: riku . voipio
Subject: [Qemu-devel] [PATCH 6/8] linux-user: translate signal number on return from sigtimedwait
Date: Mon, 10 Mar 2014 14:22:58 +0200

From: Petar Jovanovic <address@hidden>

On success, sigtimedwait() returns a signal number that needs to be
translated from a host value to a target value.

This change also fixes issues with sigwait (that is implemented using
sigtimedwait()).

Signed-off-by: Petar Jovanovic <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
---
 linux-user/syscall.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1f64867..e2c10cc 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6185,11 +6185,17 @@ abi_long do_syscall(void *cpu_env, int num, abi_long 
arg1,
                 puts = NULL;
             }
             ret = get_errno(sigtimedwait(&set, &uinfo, puts));
-            if (!is_error(ret) && arg2) {
-                if (!(p = lock_user(VERIFY_WRITE, arg2, 
sizeof(target_siginfo_t), 0)))
-                    goto efault;
-                host_to_target_siginfo(p, &uinfo);
-                unlock_user(p, arg2, sizeof(target_siginfo_t));
+            if (!is_error(ret)) {
+                if (arg2) {
+                    p = lock_user(VERIFY_WRITE, arg2, sizeof(target_siginfo_t),
+                                  0);
+                    if (!p) {
+                        goto efault;
+                    }
+                    host_to_target_siginfo(p, &uinfo);
+                    unlock_user(p, arg2, sizeof(target_siginfo_t));
+                }
+                ret = host_to_target_signal(ret);
             }
         }
         break;
-- 
1.8.1.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]