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

Signed-off-by: Timothy Edward Baldwin <t.e.baldwi...@members.leeds.ac.uk>
---
 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