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) {