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>
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;
}