qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PULL 19/44] linux-user: Restart exit() if signal pending


From: riku . voipio
Subject: [Qemu-devel] [PULL 19/44] linux-user: Restart exit() if signal pending
Date: Wed, 8 Jun 2016 16:30:00 +0300

From: Timothy E Baldwin <address@hidden>

Without this a signal could vanish on thread exit.

Signed-off-by: Timothy Edward Baldwin <address@hidden>
Message-id: address@hidden
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
 linux-user/syscall.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index aa5517c..f3061a9 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6640,8 +6640,12 @@ abi_long do_syscall(void *cpu_env, int num, abi_long 
arg1,
            However in threaded applictions it is used for thread termination,
            and _exit_group is used for application termination.
            Do thread termination if we have more then one thread.  */
-        /* FIXME: This probably breaks if a signal arrives.  We should probably
-           be disabling signals.  */
+
+        if (block_signals()) {
+            ret = -TARGET_ERESTARTSYS;
+            break;
+        }
+
         if (CPU_NEXT(first_cpu)) {
             TaskState *ts;
 
-- 
2.1.4




reply via email to

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