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>
This commit is contained in:
Michel Dänzer
2017-04-26 18:31:08 +09:00
committed by Adam Jackson
parent 23f2f1932a
commit 27a6b9f7c8
4 changed files with 9 additions and 0 deletions

View File

@@ -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();
}