[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] ivshmem-server: Terminate also on SIGINT
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH] ivshmem-server: Terminate also on SIGINT |
Date: |
Sat, 3 Aug 2019 13:48:13 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
From: Jan Kiszka <address@hidden>
Allows to shutdown a foreground session via ctrl-c.
Signed-off-by: Jan Kiszka <address@hidden>
---
contrib/ivshmem-server/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/contrib/ivshmem-server/main.c b/contrib/ivshmem-server/main.c
index 197c79c57e..8a81cdb04c 100644
--- a/contrib/ivshmem-server/main.c
+++ b/contrib/ivshmem-server/main.c
@@ -223,7 +223,8 @@ 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) {
+ sigaction(SIGTERM, &sa_quit, 0) == -1 ||
+ sigaction(SIGINT, &sa_quit, 0) == -1) {
perror("failed to add SIGTERM handler; sigaction");
goto err;
}
--
2.16.4
- [Qemu-devel] [PATCH] ivshmem-server: Terminate also on SIGINT,
Jan Kiszka <=