From: Jan Kiszka <jan.kiszka@web.de>
To: qemu-devel <qemu-devel@nongnu.org>
Cc: Claudio Fontana <cfontana@suse.de>
Subject: [Qemu-devel] [PATCH v2] ivshmem-server: Terminate also on SIGINT
Date: Sat, 3 Aug 2019 15:22:04 +0200 [thread overview]
Message-ID: <99c1a7bd-1876-66a2-4b8e-d5bc86116fe7@web.de> (raw)
From: Jan Kiszka <jan.kiszka@siemens.com>
Allows to shutdown a foreground session via ctrl-c.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
Changes in v2:
- adjust error message
contrib/ivshmem-server/main.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/contrib/ivshmem-server/main.c b/contrib/ivshmem-server/main.c
index 197c79c57e..e4cd35f74c 100644
--- a/contrib/ivshmem-server/main.c
+++ b/contrib/ivshmem-server/main.c
@@ -223,8 +223,9 @@ main(int argc, char *argv[])
sa_quit.sa_handler = ivshmem_server_quit_cb;
sa_quit.sa_flags = 0;
if (sigemptyset(&sa_quit.sa_mask) == -1 ||
- sigaction(SIGTERM, &sa_quit, 0) == -1) {
- perror("failed to add SIGTERM handler; sigaction");
+ sigaction(SIGTERM, &sa_quit, 0) == -1 ||
+ sigaction(SIGINT, &sa_quit, 0) == -1) {
+ perror("failed to add signal handler; sigaction");
goto err;
}
--
2.16.4
next reply other threads:[~2019-08-03 13:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-03 13:22 Jan Kiszka [this message]
2019-08-04 2:00 ` [Qemu-devel] [PATCH v2] ivshmem-server: Terminate also on SIGINT Claudio Fontana
2019-08-05 8:33 ` Stefano Garzarella
2019-08-05 10:06 ` Jan Kiszka
2019-11-08 9:08 ` Jan Kiszka
2019-11-08 15:15 ` Markus Armbruster
2019-11-12 9:37 ` Laurent Vivier
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=99c1a7bd-1876-66a2-4b8e-d5bc86116fe7@web.de \
--to=jan.kiszka@web.de \
--cc=cfontana@suse.de \
--cc=qemu-devel@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).