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
diff --git a/lib/System/Unix/Signals.inc b/lib/System/Unix/Signals.inc
index 7b7c43e..dcbda4e 100644
--- a/lib/System/Unix/Signals.inc
+++ b/lib/System/Unix/Signals.inc
@@ -274,6 +274,10 @@
#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 @@
#include <pthread.h>
void abort() {
- pthread_kill(pthread_self(), SIGABRT);
+ raise(SIGABRT);
usleep(1000);
__builtin_trap();
}