summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-09-22 17:46:10 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-09-22 17:46:10 +0000
commit18456f3d734693e3a448e8ff301866768074a710 (patch)
treefffb58e368f13570cb2d7157c70e49cda3af56ce /llvm/lib/System
parent6594b8cc9bbf5c0c68990e06ff027d867a33e8a1 (diff)
downloadbcm5719-llvm-18456f3d734693e3a448e8ff301866768074a710.tar.gz
bcm5719-llvm-18456f3d734693e3a448e8ff301866768074a710.zip
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. llvm-svn: 114558
Diffstat (limited to 'llvm/lib/System')
-rw-r--r--llvm/lib/System/Unix/Signals.inc6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/System/Unix/Signals.inc b/llvm/lib/System/Unix/Signals.inc
index 7b7c43efc78..dcbda4e008d 100644
--- a/llvm/lib/System/Unix/Signals.inc
+++ b/llvm/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();
}
OpenPOWER on IntegriCloud