qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 26/34] linux-user: Restart kill() if signal pending


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

Without this a signal could vanish if thread sends SIGKILL to itself.

Signed-off-by: Timothy Edward Baldwin <address@hidden>
---
 linux-user/syscall.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index efe61e3..da6d140 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6205,7 +6205,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long 
arg1,
         ret = 0;
         break;
     case TARGET_NR_kill:
-        ret = get_errno(kill(arg1, target_to_host_signal(arg2)));
+        if (block_signals()) {
+            ret = -TARGET_ERESTARTSYS;
+        } else {
+            ret = get_errno(kill(arg1, target_to_host_signal(arg2)));
+        }
         break;
     case TARGET_NR_rename:
         {
-- 
2.1.4




reply via email to

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