From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, patches@linaro.org
Subject: [Qemu-devel] [PATCH] iohandler.c: Properly initialize sigaction struct
Date: Fri, 16 May 2014 14:00:03 +0100 [thread overview]
Message-ID: <1400245203-32005-1-git-send-email-peter.maydell@linaro.org> (raw)
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>
---
Pretty harmless, but spotted by coverity.
iohandler.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/iohandler.c b/iohandler.c
index ae2ef8f..cca614f 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);
--
1.9.2
next reply other threads:[~2014-05-16 13:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-16 13:00 Peter Maydell [this message]
2014-05-17 7:56 ` [Qemu-devel] [Qemu-trivial] [PATCH] iohandler.c: Properly initialize sigaction struct Michael Tokarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1400245203-32005-1-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=patches@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).