add sigint user handle

This commit is contained in:
taynpg 2025-04-16 11:27:28 -04:00
parent 5ec7814181
commit 2cf72f3e5c

View File

@ -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 (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);