[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 14/19] linux-user: Restart exit() if signal pendi
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PATCH v2 14/19] linux-user: Restart exit() if signal pending |
Date: |
Fri, 27 May 2016 15:51:56 +0100 |
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>
---
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 3fc9c8a..cb5d519 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5999,8 +5999,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;
--
1.9.1
- [Qemu-devel] [PATCH v2 00/19] linux-user: fix various signal race conditions, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 16/19] linux-user: Restart fork() if signals pending, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 18/19] linux-user: Avoid possible misalignment in host_to_target_siginfo(), Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 14/19] linux-user: Restart exit() if signal pending,
Peter Maydell <=
- [Qemu-devel] [PATCH v2 11/19] linux-user: Queue synchronous signals separately, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 12/19] linux-user: Block signals during sigaction() handling, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 13/19] linux-user: pause() should not pause if signal pending, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 03/19] linux-user: Fix stray tab-indent, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 09/19] linux-user: Remove redundant gdb_queuesig(), Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 08/19] linux-user: Remove redundant default action check in queue_signal(), Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 10/19] linux-user: Remove real-time signal queuing, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 06/19] linux-user: Use safe_syscall for sigsuspend syscalls, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 05/19] linux-user: Define macro for size of host kernel sigset_t, Peter Maydell, 2016/05/27
- [Qemu-devel] [PATCH v2 07/19] linux-user: Fix race between multiple signals, Peter Maydell, 2016/05/27