summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2017-04-26 18:31:08 +0900
committerAdam Jackson <ajax@redhat.com>2017-09-25 15:34:10 -0400
commitb3de3ebcf450fd4ab1543dd2f133e45e9c0b9e7e (patch)
tree344b0b12ecc5d057b8a4d8bfdd230e817d286275 /os
parente59a32c897c9f093f54ce4b695e9aff1ba20bda2 (diff)
os: Handle SIGABRT
Without this, assertion failures can make life hard for users and those trying to help them. v2: * Change commit log wording slightly to "can make life hard", since apparently e.g. logind can alleviate that somewhat. * Set default handler for SIGABRT in hw/xfree86/common/xf86Init.c:InstallSignalHandlers() and hw/xquartz/quartz.c:QuartzInitOutput() (Eric Anholt) Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> (cherry picked from commit 27a6b9f7c84c914d0f5909ec1069d72f5035bc04)
Diffstat (limited to 'os')
-rw-r--r--os/osinit.c1
-rw-r--r--os/utils.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/os/osinit.c b/os/osinit.c
index 5b2f6b546..cd769d181 100644
--- a/os/osinit.c
+++ b/os/osinit.c
@@ -173,6 +173,7 @@ OsInit(void)
int i;
int siglist[] = { SIGSEGV, SIGQUIT, SIGILL, SIGFPE, SIGBUS,
+ SIGABRT,
SIGSYS,
SIGXCPU,
SIGXFSZ,
diff --git a/os/utils.c b/os/utils.c
index ac55cd79f..7379121b5 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1352,6 +1352,12 @@ OsAbort(void)
#ifndef __APPLE__
OsBlockSignals();
#endif
+#if !defined(WIN32) || defined(__CYGWIN__)
+ /* abort() raises SIGABRT, so we have to stop handling that to prevent
+ * recursion
+ */
+ OsSignal(SIGABRT, SIG_DFL);
+#endif
abort();
}