]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
iohandler.c: Properly initialize sigaction struct
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 16 May 2014 13:00:03 +0000 (14:00 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 23 May 2014 20:07:29 +0000 (00:07 +0400)
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>
iohandler.c

index ae2ef8f9669db23dd004337f382a257e84044ad5..cca614f087f6be5c975dc773c7e6aa6cacc28fe2 100644 (file)
@@ -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);