From 2cf72f3e5c5313527b5d1442017caf06d51a3c02 Mon Sep 17 00:00:00 2001 From: taynpg Date: Wed, 16 Apr 2025 11:27:28 -0400 Subject: [PATCH] add sigint user handle --- crashelper/include/backward.hpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crashelper/include/backward.hpp b/crashelper/include/backward.hpp index 3bffd45..b7e1610 100644 --- a/crashelper/include/backward.hpp +++ b/crashelper/include/backward.hpp @@ -4335,6 +4335,7 @@ public: SIGTRAP, // Trace/breakpoint trap SIGXCPU, // CPU time limit exceeded (4.2BSD) SIGXFSZ, // File size limit exceeded (4.2BSD) + SIGINT, #if defined(BACKWARD_SYSTEM_DARWIN) SIGEMT, // emulation instruction executed #endif @@ -4460,10 +4461,13 @@ private: static void sig_handler(int signo, siginfo_t* info, void* _ctx) { - handleSignal(signo, info, _ctx); - if (user_sig_handler_) { - user_sig_handler_(signo); + if (signo == SIGINT) { + if (user_sig_handler_) { + user_sig_handler_(signo); + } + _exit(EXIT_FAILURE); } + handleSignal(signo, info, _ctx); // try to forward the signal. raise(info->si_signo);