From: Peter Maydell Date: Fri, 16 May 2014 13:00:03 +0000 (+0100) Subject: iohandler.c: Properly initialize sigaction struct X-Git-Tag: qemu-xen-4.6.0-rc1~433^2~21 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=aef553fdcabbea8760cd4647ab14859095300023;p=qemu-upstream-4.6-testing.git 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 Signed-off-by: Michael Tokarev --- diff --git a/iohandler.c b/iohandler.c index ae2ef8f96..cca614f08 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);