From 9b2a5690df7535b5760b9c959231b5702efb8a12 Mon Sep 17 00:00:00 2001
From: taynpg <taynpg@163.com>
Date: Fri, 16 May 2025 11:40:17 +0800
Subject: [PATCH] =?UTF-8?q?change=EF=BC=9A=E6=B7=BB=E5=8A=A0win=E4=B8=8BSI?=
 =?UTF-8?q?GINT=E5=8D=95=E7=8B=AC=E8=A7=A6=E5=8F=91=E7=94=A8=E6=88=B7?=
 =?UTF-8?q?=E5=9B=9E=E8=B0=83=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 crashelper/include/backward.hpp | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/crashelper/include/backward.hpp b/crashelper/include/backward.hpp
index b7e1610..5e3feb9 100644
--- a/crashelper/include/backward.hpp
+++ b/crashelper/include/backward.hpp
@@ -4335,7 +4335,7 @@ public:
             SIGTRAP,   // Trace/breakpoint trap
             SIGXCPU,   // CPU time limit exceeded (4.2BSD)
             SIGXFSZ,   // File size limit exceeded (4.2BSD)
-            SIGINT, 
+            SIGINT,
 #if defined(BACKWARD_SYSTEM_DARWIN)
             SIGEMT,   // emulation instruction executed
 #endif
@@ -4462,9 +4462,9 @@ private:
     sig_handler(int signo, siginfo_t* info, void* _ctx)
     {
         if (signo == SIGINT) {
-	    if (user_sig_handler_) {
-            	user_sig_handler_(signo);
-	    }
+            if (user_sig_handler_) {
+                user_sig_handler_(signo);
+            }
             _exit(EXIT_FAILURE);
         }
         handleSignal(signo, info, _ctx);
@@ -4528,6 +4528,7 @@ public:
         SetUnhandledExceptionFilter(crash_handler);
 
         signal(SIGABRT, signal_handler);
+        signal(SIGINT, msignal_handler);
         _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
 
         std::set_terminate(&terminator);
@@ -4629,6 +4630,13 @@ private:
         abort();
     }
 
+    static inline void msignal_handler(int sig)
+    {
+        if (user_sig_handler_) {
+            user_sig_handler_(sig);
+        }
+    }
+
     static inline void __cdecl invalid_parameter_handler(const wchar_t*, const wchar_t*, const wchar_t*, unsigned int,
                                                          uintptr_t)
     {