diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-09-22 17:46:10 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-09-22 17:46:10 +0000 |
commit | e4e06a86bcacaf0693bfa80b555096fe6f38f4e6 (patch) | |
tree | 1d1fb0481cd95009d5e64e207d785a080954324e /lib/System/Unix/Signals.inc | |
parent | 1963572f9de87cd1ac5f16e504e27c3c26267e6f (diff) |
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
Diffstat (limited to 'lib/System/Unix/Signals.inc')
-rw-r--r-- | lib/System/Unix/Signals.inc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/System/Unix/Signals.inc b/lib/System/Unix/Signals.inc index 7b7c43efc7..dcbda4e008 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 <pthread.h> void abort() { - pthread_kill(pthread_self(), SIGABRT); + raise(SIGABRT); usleep(1000); __builtin_trap(); } |