diff mbox

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

Message ID 1441497448-32489-27-git-send-email-T.E.Baldwin99@members.leeds.ac.uk
State New
Headers show

Commit Message

Timothy Baldwin Sept. 5, 2015, 11:57 p.m. UTC
Without this a signal could vanish if thread sends SIGKILL to itself.

Signed-off-by: Timothy Edward Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
---
 linux-user/syscall.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox

Patch

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:
         {