aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Raymond <cerbere@gmail.com>2011-06-14 10:05:36 -0400
committerBlue Swirl <blauwirbel@gmail.com>2011-07-16 19:41:08 +0000
commit5664aed99a4ab6e661b40e475449a32150f46184 (patch)
tree9e5bc8f7389590a674dca733bdf74566820033c1
parent107a47cc2dac1b6c5edae0121831713161cb70c5 (diff)
Fix signal handling when io-thread is disabled
Changes since v1: - take pthread_sigmask() out of the ifdef as it is now common to both parts. This fix effectively blocks, in the main thread, the signals handled by signalfd or the compatibility signal thread. This way, such signals are received synchronously in the main thread through sigfd_handler() instead of triggering the signal handler directly, asynchronously. Signed-off-by: Alexandre Raymond <cerbere@gmail.com> Acked-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rw-r--r--cpus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cpus.c b/cpus.c
index abd24ab31c..e02576cb66 100644
--- a/cpus.c
+++ b/cpus.c
@@ -401,7 +401,6 @@ static int qemu_signal_init(void)
sigaddset(&set, SIGALRM);
sigaddset(&set, SIG_IPI);
sigaddset(&set, SIGBUS);
- pthread_sigmask(SIG_BLOCK, &set, NULL);
#else
sigemptyset(&set);
sigaddset(&set, SIGBUS);
@@ -414,6 +413,7 @@ static int qemu_signal_init(void)
sigaddset(&set, SIGALRM);
}
#endif
+ pthread_sigmask(SIG_BLOCK, &set, NULL);
sigfd = qemu_signalfd(&set);
if (sigfd == -1) {