diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/core.c | 11 | ||||
-rw-r--r-- | src/common/core.h | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/common/core.c b/src/common/core.c index 5924a0aa6..60d25546a 100644 --- a/src/common/core.c +++ b/src/common/core.c @@ -92,6 +92,13 @@ static void sig_proc(int sn) exit(0); runflag = 0; break; + case SIGSEGV: + case SIGFPE: + do_abort(); + // Pass the signal to the system's default handler + compat_signal(sn, SIG_DFL); + raise(sn); + break; #ifndef _WIN32 case SIGXFSZ: // ignore and allow it to set errno to EFBIG @@ -109,10 +116,10 @@ void signals_init (void) { compat_signal(SIGTERM, sig_proc); compat_signal(SIGINT, sig_proc); + compat_signal(SIGSEGV, sig_proc); + compat_signal(SIGFPE, sig_proc); // Signal to create coredumps by system when necessary (crash) - compat_signal(SIGSEGV, SIG_DFL); - compat_signal(SIGFPE, SIG_DFL); compat_signal(SIGILL, SIG_DFL); #ifndef _WIN32 compat_signal(SIGXFSZ, sig_proc); diff --git a/src/common/core.h b/src/common/core.h index 5e396cc7a..f59a87e3e 100644 --- a/src/common/core.h +++ b/src/common/core.h @@ -18,6 +18,7 @@ extern const char *get_svn_revision(void); extern int do_init(int,char**); extern void set_server_type(void); extern void set_termfunc(void (*termfunc)(void)); +extern void do_abort(void); extern void do_final(void); #endif /* _CORE_H_ */ |