From 918b111961c37cf6f99d1268f6ceaff88755a607 Mon Sep 17 00:00:00 2001 From: Grammatopoulos Athanasios Vasileios Date: Sat, 19 Aug 2023 20:00:42 +0300 Subject: [PATCH] properly set up the struct sigaction (#386) Based on https://stackoverflow.com/questions/49292180/bash-on-ubuntu-on-windows-signal-handler-does-not-work --- src/lib/suspend.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/suspend.h b/src/lib/suspend.h index 5fb60277..464f034c 100644 --- a/src/lib/suspend.h +++ b/src/lib/suspend.h @@ -27,6 +27,7 @@ class thread_suspend_handle { initialize() { // Set process-wide signal handler struct sigaction handler; + memset(&handler, '\0', sizeof(handler)); handler.sa_handler = callback; sigemptyset(&handler.sa_mask); assert(sigaction(SIGRTMIN, &handler, nullptr) == 0);