summaryrefslogtreecommitdiff
path: root/hw
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 /hw
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 'hw')
-rw-r--r--hw/xquartz/GL/capabilities.c3
-rw-r--r--hw/xquartz/darwin.c10
-rw-r--r--hw/xquartz/mach-startup/bundle-main.c11
3 files changed, 10 insertions, 14 deletions
diff --git a/hw/xquartz/GL/capabilities.c b/hw/xquartz/GL/capabilities.c
index 2c5ec658c..fc7dd57dd 100644
--- a/hw/xquartz/GL/capabilities.c
+++ b/hw/xquartz/GL/capabilities.c
@@ -525,8 +525,7 @@ bool getGlCapabilities(struct glCapabilities *cap) {
conf = malloc(sizeof(*conf));
if(NULL == conf) {
- perror("malloc");
- OsAbort();
+ FatalError("Unable to allocate memory for OpenGL capabilities\n");
}
/* Copy the struct. */
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 066f5a596..d3f448820 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -602,7 +602,7 @@ void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv )
/*
- * OsVendorFataError
+ * OsVendorFatalError
*/
void OsVendorFatalError( void )
{
@@ -760,7 +760,7 @@ void ddxUseMsg( void )
*/
void ddxGiveUp( void )
{
- ErrorF( "Quitting Xquartz...\n" );
+ ErrorF( "Quitting Xquartz\n" );
}
@@ -773,11 +773,7 @@ void ddxGiveUp( void )
void AbortDDX( void )
{
ErrorF( " AbortDDX\n" );
- /*
- * This is needed for a abnormal server exit, since the normal exit stuff
- * MUST also be performed (i.e. the vt must be left in a defined state)
- */
- ddxGiveUp();
+ OsAbort();
}
#include "mivalidate.h" // for union _Validate used by windowstr.h
diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index 4872ff59b..625b8b4c2 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -73,10 +73,11 @@ extern int noPanoramiXExtension;
#define XSERVER_VERSION "?"
#endif
-const int __crashreporter_info__len = 4096;
-const char *__crashreporter_info__base = "X.Org X Server " XSERVER_VERSION " Build Date: " BUILD_DATE;
-char __crashreporter_info__buf[4096];
-char *__crashreporter_info__ = __crashreporter_info__buf;
+static char __crashreporter_info_buff__[4096] = {0};
+static const char *__crashreporter_info__ = &__crashreporter_info_buff__[0];
+asm (".desc __crashreporter_info__, 0x10");
+
+static const char *__crashreporter_info__base = "X.Org X Server " XSERVER_VERSION " Build Date: " BUILD_DATE;
static char *launchd_id_prefix = NULL;
static char *server_bootstrap_name = NULL;
@@ -548,7 +549,7 @@ int main(int argc, char **argv, char **envp) {
noPanoramiXExtension = TRUE;
/* Setup the initial crasherporter info */
- strlcpy(__crashreporter_info__, __crashreporter_info__base, __crashreporter_info__len);
+ strlcpy(__crashreporter_info_buff__, __crashreporter_info__base, sizeof(__crashreporter_info_buff__));
fprintf(stderr, "X11.app: main(): argc=%d\n", argc);
for(i=0; i < argc; i++) {