From: Jan Kiszka Date: Sat, 3 Aug 2019 13:22:04 +0000 (+0200) Subject: ivshmem-server: Terminate also on SIGINT X-Git-Tag: v4.2.0-rc1~4^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5c62979ed5f75976ae215098566ebd93dfe4e22a;p=thirdparty%2Fqemu.git ivshmem-server: Terminate also on SIGINT Allows to shutdown a foreground session via ctrl-c. Signed-off-by: Jan Kiszka Reviewed-by: Claudio Fontana Reviewed-by: Stefano Garzarella Message-Id: <99c1a7bd-1876-66a2-4b8e-d5bc86116fe7@web.de> Signed-off-by: Laurent Vivier --- diff --git a/contrib/ivshmem-server/main.c b/contrib/ivshmem-server/main.c index 197c79c57ec..e4cd35f74c6 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; }