aboutsummaryrefslogtreecommitdiff
path: root/iohandler.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-05-16 14:00:03 +0100
committerMichael Tokarev <mjt@tls.msk.ru>2014-05-24 00:07:29 +0400
commitaef553fdcabbea8760cd4647ab14859095300023 (patch)
tree40849a5877bda3fdae17ab1f77a4d480514216b9 /iohandler.c
parent78a4b8d2051bff8e8794e9419b7925122212b096 (diff)
iohandler.c: Properly initialize sigaction struct
The code in qemu_init_child_watch() wasn't clearing the 'struct sigaction' before passing it to sigaction(); this meant that we would block a random set of signals while executing the SIGCHLD handler. Initialize properly by using memset() on the struct, as we do in similar cases elsewhere. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'iohandler.c')
-rw-r--r--iohandler.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/iohandler.c b/iohandler.c
index ae2ef8f966..cca614f087 100644
--- a/iohandler.c
+++ b/iohandler.c
@@ -191,6 +191,7 @@ static void qemu_init_child_watch(void)
struct sigaction act;
sigchld_bh = qemu_bh_new(sigchld_bh_handler, NULL);
+ memset(&act, 0, sizeof(act));
act.sa_handler = sigchld_handler;
act.sa_flags = SA_NOCLDSTOP;
sigaction(SIGCHLD, &act, NULL);