summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2010-03-27 17:35:10 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2010-03-29 09:37:17 -0700
commit436d0bb9cca122bfdde32902b683d2499f61e6fc (patch)
treed0f286171640b092de061b7d8bbc5fa823ce0990 /os
parent73b3b67aac9f3938a96cb8822b9c270bd82ded5c (diff)
darwin: Generate crash reports on FatalError()
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Acked-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'os')
-rw-r--r--os/log.c9
-rw-r--r--os/utils.c2
2 files changed, 11 insertions, 0 deletions
diff --git a/os/log.c b/os/log.c
index f4832c12f..c1301d754 100644
--- a/os/log.c
+++ b/os/log.c
@@ -117,6 +117,12 @@ static char *saveBuffer = NULL;
static int bufferSize = 0, bufferUnused = 0, bufferPos = 0;
static Bool needBuffer = TRUE;
+#ifdef __APPLE__
+static char __crashreporter_info_buff__[4096] = {0};
+static const char *__crashreporter_info__ = &__crashreporter_info_buff__[0];
+asm (".desc __crashreporter_info__, 0x10");
+#endif
+
/* Prefix strings for log messages. */
#ifndef X_UNKNOWN_STRING
#define X_UNKNOWN_STRING "(\?\?)"
@@ -527,6 +533,9 @@ FatalError(const char *f, ...)
ErrorF("\nFatal server error:\n");
va_start(args, f);
+#ifdef __APPLE__
+ (void)vsnprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__), f, args);
+#endif
VErrorF(f, args);
va_end(args);
ErrorF("\n");
diff --git a/os/utils.c b/os/utils.c
index 5a5a20374..13d3b3ff0 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1315,7 +1315,9 @@ OsReleaseSignals (void)
void
OsAbort (void)
{
+#ifndef __APPLE__
OsBlockSignals();
+#endif
abort();
}