diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-09-10 00:17:59 +0200 |
---|---|---|
committer | cgzones <cgzones@googlemail.com> | 2020-09-17 21:54:21 +0200 |
commit | 5d4061732f25863d78cca06968cd938ae468b8bf (patch) | |
tree | f92c46629413216edf6af1aa034c2d704b0ed01b /CRT.c | |
parent | 00665e2a2b9c6efca6cd1f1dbaca0a91ccb31534 (diff) |
Allow third party sigsegv handler
For example from sanitizers.
Diffstat (limited to 'CRT.c')
-rw-r--r-- | CRT.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -552,6 +552,8 @@ void CRT_restorePrivileges() { // TODO: pass an instance of Settings instead. +struct sigaction old_sigsegv_handler; + void CRT_init(int delay, int colorScheme, bool allowUnicode) { initscr(); noecho(); @@ -605,7 +607,11 @@ void CRT_init(int delay, int colorScheme, bool allowUnicode) { } } #ifndef DEBUG - signal(11, CRT_handleSIGSEGV); + struct sigaction act; + sigemptyset (&act.sa_mask); + act.sa_flags = (int)SA_RESETHAND; + act.sa_handler = CRT_handleSIGSEGV; + sigaction (SIGSEGV, &act, &old_sigsegv_handler); #endif signal(SIGTERM, CRT_handleSIGTERM); signal(SIGQUIT, CRT_handleSIGTERM); |