aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy E Baldwin <T.E.Baldwin99@members.leeds.ac.uk>2016-05-27 15:18:40 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-05-27 15:18:40 +0100
commitcbc9f5e9e70da7b42b09fc1e92ecc77316f7889a (patch)
tree98997d4d92ae0483e0a7bf580e64e26b6dad5921
parent5cb0adba4236107e2cd61b8db0c573dd531d158a (diff)
downloadqemu-arm-cbc9f5e9e70da7b42b09fc1e92ecc77316f7889a.tar.gz
linux-user: Restart exit() if signal pending
Without this a signal could vanish on thread exit. Signed-off-by: Timothy Edward Baldwin <T.E.Baldwin99@members.leeds.ac.uk> Message-id: 1441497448-32489-26-git-send-email-T.E.Baldwin99@members.leeds.ac.uk Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--linux-user/syscall.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 3fc9c8a187..cb5d519282 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;