qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 28/34] linux-user: Restart sigaction() if signal pen


From: Timothy E Baldwin
Subject: [Qemu-devel] [PATCH 28/34] linux-user: Restart sigaction() if signal pending
Date: Sun, 6 Sep 2015 00:57:22 +0100

Signed-off-by: Timothy Edward Baldwin <address@hidden>
---
 linux-user/signal.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/linux-user/signal.c b/linux-user/signal.c
index 15bd082..fc37f3b 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -629,7 +629,7 @@ out:
     return ret;
 }
 
-/* do_sigaction() return host values and errnos */
+/* do_sigaction() return target values and host errnos */
 int do_sigaction(int sig, const struct target_sigaction *act,
                  struct target_sigaction *oact)
 {
@@ -638,8 +638,14 @@ int do_sigaction(int sig, const struct target_sigaction 
*act,
     int host_sig;
     int ret = 0;
 
-    if (sig < 1 || sig > TARGET_NSIG || sig == TARGET_SIGKILL || sig == 
TARGET_SIGSTOP)
-        return -EINVAL;
+    if (sig < 1 || sig > TARGET_NSIG || sig == TARGET_SIGKILL || sig == 
TARGET_SIGSTOP) {
+        return -TARGET_EINVAL;
+    }
+
+    if (block_signals()) {
+        return -TARGET_ERESTARTSYS;
+    }
+
     k = &sigact_table[sig - 1];
 #if defined(DEBUG_SIGNAL)
     fprintf(stderr, "sigaction sig=%d act=0x%p, oact=0x%p\n",
-- 
2.1.4




reply via email to

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