add signal handlers for Windows SIGBREAK
authorBrandon Paupore <brandon.paupore@wdc.com>
Tue, 28 Sep 2021 17:12:15 +0000 (12:12 -0500)
committerBrandon Paupore <brandon.paupore@wdc.com>
Tue, 28 Sep 2021 17:12:15 +0000 (12:12 -0500)
Signed-off-by: Brandon Paupore <brandon.paupore@wdc.com>
server.c
t/io_uring.c

index 859a401b2e528da99c41674c6145514883e62953..90c52e01ac231f4972bbd94e91361d3fe61ad132 100644 (file)
--- 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)
index f22c504afc6ad3dbab725dcb1395ba725d7bb196..e5568aa2e5a8f8420e714bfb0752c04feb762497 100644 (file)
@@ -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)