CrashRecovery/Darwin: Override raise() as well so that crash recovery doesn't
authorDaniel Dunbar <daniel@zuster.org>
Wed, 22 Sep 2010 17:46:10 +0000 (17:46 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 22 Sep 2010 17:46:10 +0000 (17:46 +0000)
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

index 7b7c43efc78648ece431c89eae5fb2ffe942dcc1..dcbda4e008dfcca3d8f9779c83337098572e3ecd 100644 (file)
@@ -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();
 }