From e4e06a86bcacaf0693bfa80b555096fe6f38f4e6 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 22 Sep 2010 17:46:10 +0000 Subject: [PATCH] CrashRecovery/Darwin: Override raise() as well so that crash recovery doesn't end up altering the thread on which crashes are done because of its use of Darwin's broken raise() implementation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114558 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/System/Unix/Signals.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/System/Unix/Signals.inc b/lib/System/Unix/Signals.inc index 7b7c43efc78..dcbda4e008d 100644 --- a/lib/System/Unix/Signals.inc +++ b/lib/System/Unix/Signals.inc @@ -274,6 +274,10 @@ void llvm::sys::PrintStackTraceOnErrorSignal() { #ifdef __APPLE__ +int raise(int sig) { + return pthread_kill(pthread_self(), SIGABRT); +} + void __assert_rtn(const char *func, const char *file, int line, @@ -291,7 +295,7 @@ void __assert_rtn(const char *func, #include void abort() { - pthread_kill(pthread_self(), SIGABRT); + raise(SIGABRT); usleep(1000); __builtin_trap(); } -- 2.11.0