diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2019-08-03 15:22:04 +0200 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2019-11-12 10:37:20 +0100 |
commit | 5c62979ed5f75976ae215098566ebd93dfe4e22a (patch) | |
tree | c0e930f018364c128d3caed584e29393cb966be7 /contrib/ivshmem-server | |
parent | 0602a6166df861c9fbbe72321c1a598c5fe1feb4 (diff) |
ivshmem-server: Terminate also on SIGINT
Allows to shutdown a foreground session via ctrl-c.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Claudio Fontana <claudio.fontana@suse.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <99c1a7bd-1876-66a2-4b8e-d5bc86116fe7@web.de>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'contrib/ivshmem-server')
-rw-r--r-- | contrib/ivshmem-server/main.c | 5 |
1 files 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; } |