add sigint user handle
This commit is contained in:
parent
5ec7814181
commit
2cf72f3e5c
@ -4335,6 +4335,7 @@ public:
|
|||||||
SIGTRAP, // Trace/breakpoint trap
|
SIGTRAP, // Trace/breakpoint trap
|
||||||
SIGXCPU, // CPU time limit exceeded (4.2BSD)
|
SIGXCPU, // CPU time limit exceeded (4.2BSD)
|
||||||
SIGXFSZ, // File size limit exceeded (4.2BSD)
|
SIGXFSZ, // File size limit exceeded (4.2BSD)
|
||||||
|
SIGINT,
|
||||||
#if defined(BACKWARD_SYSTEM_DARWIN)
|
#if defined(BACKWARD_SYSTEM_DARWIN)
|
||||||
SIGEMT, // emulation instruction executed
|
SIGEMT, // emulation instruction executed
|
||||||
#endif
|
#endif
|
||||||
@ -4460,10 +4461,13 @@ private:
|
|||||||
static void
|
static void
|
||||||
sig_handler(int signo, siginfo_t* info, void* _ctx)
|
sig_handler(int signo, siginfo_t* info, void* _ctx)
|
||||||
{
|
{
|
||||||
handleSignal(signo, info, _ctx);
|
if (signo == SIGINT) {
|
||||||
if (user_sig_handler_) {
|
if (user_sig_handler_) {
|
||||||
user_sig_handler_(signo);
|
user_sig_handler_(signo);
|
||||||
}
|
}
|
||||||
|
_exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
handleSignal(signo, info, _ctx);
|
||||||
// try to forward the signal.
|
// try to forward the signal.
|
||||||
raise(info->si_signo);
|
raise(info->si_signo);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user