From c0181b46d1447e2ce07b8dbb7801bdbf01094ca1 Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Fri, 18 Oct 2024 14:16:45 +0000 Subject: [PATCH] hackrf-tools: handle ctrl+break signal on windows --- host/hackrf-tools/src/hackrf_sweep.c | 2 +- host/hackrf-tools/src/hackrf_transfer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/host/hackrf-tools/src/hackrf_sweep.c b/host/hackrf-tools/src/hackrf_sweep.c index 85a47a5be..992296b49 100644 --- a/host/hackrf-tools/src/hackrf_sweep.c +++ b/host/hackrf-tools/src/hackrf_sweep.c @@ -415,7 +415,7 @@ static hackrf_device* device = NULL; #ifdef _MSC_VER BOOL WINAPI sighandler(int signum) { - if (CTRL_C_EVENT == signum) { + if (CTRL_C_EVENT == signum || CTRL_BREAK_EVENT == signum) { fprintf(stderr, "Caught signal %d\n", signum); do_exit = true; return TRUE; diff --git a/host/hackrf-tools/src/hackrf_transfer.c b/host/hackrf-tools/src/hackrf_transfer.c index 380bb0653..fcef4a93c 100644 --- a/host/hackrf-tools/src/hackrf_transfer.c +++ b/host/hackrf-tools/src/hackrf_transfer.c @@ -704,7 +704,7 @@ static hackrf_device* device = NULL; #ifdef _WIN32 BOOL WINAPI sighandler(int signum) { - if (CTRL_C_EVENT == signum) { + if (CTRL_C_EVENT == signum || CTRL_BREAK_EVENT == signum) { interrupted = true; fprintf(stderr, "Caught signal %d\n", signum); stop_main_loop();