From 2cf71009ebae454a2dad2fac6cba20fa6f09f520 Mon Sep 17 00:00:00 2001 From: Brandon Paupore Date: Tue, 28 Sep 2021 12:12:15 -0500 Subject: [PATCH] add signal handlers for Windows SIGBREAK Signed-off-by: Brandon Paupore --- server.c | 5 +++++ t/io_uring.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/server.c b/server.c index 859a401b..90c52e01 100644 --- a/server.c +++ b/server.c @@ -2457,6 +2457,11 @@ static void set_sig_handlers(void) }; sigaction(SIGINT, &act, NULL); + + /* Windows uses SIGBREAK as a quit signal from other applications */ +#ifdef WIN32 + sigaction(SIGBREAK, &act, NULL); +#endif } void fio_server_destroy_sk_key(void) diff --git a/t/io_uring.c b/t/io_uring.c index f22c504a..e5568aa2 100644 --- a/t/io_uring.c +++ b/t/io_uring.c @@ -684,6 +684,11 @@ static void arm_sig_int(void) act.sa_handler = sig_int; act.sa_flags = SA_RESTART; sigaction(SIGINT, &act, NULL); + + /* Windows uses SIGBREAK as a quit signal from other applications */ +#ifdef WIN32 + sigaction(SIGBREAK, &act, NULL); +#endif } static int setup_ring(struct submitter *s) -- 2.25.1