Skip to content

Commit

Permalink
iohandler.c: Properly initialize sigaction struct
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
pm215 authored and Michael Tokarev committed May 23, 2014
1 parent 78a4b8d commit aef553f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions iohandler.c
Expand Up @@ -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);
Expand Down

0 comments on commit aef553f

Please sign in to comment.