add sigint user handle
This commit is contained in:
parent
5ec7814181
commit
2cf72f3e5c
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user