From 25b9dbb15f0dc98cfc6b5585e7efebf3250f64d3 Mon Sep 17 00:00:00 2001 From: marha Date: Tue, 7 Dec 2010 15:49:06 +0000 Subject: xserver pixman git update 7-12-2010 --- xorg-server/os/log.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'xorg-server/os') diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c index d95dd329c..2495b9066 100644 --- a/xorg-server/os/log.c +++ b/xorg-server/os/log.c @@ -121,7 +121,7 @@ static Bool needBuffer = TRUE; #include static char __crashreporter_info_buff__[4096] = {0}; -static const char *__crashreporter_info__ = &__crashreporter_info_buff__[0]; +static const char *__crashreporter_info__ __attribute__((__used__)) = &__crashreporter_info_buff__[0]; #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 // This is actually a toolchain requirement, but I'm not sure the correct check, // but it should be fine to just only include it for Leopard and later. This line @@ -571,21 +571,14 @@ ErrorF(const char * f, ...) /* A perror() workalike. */ void -Error(char *str) +Error(const char *str) { - char *err = NULL; - int saveErrno = errno; - - if (str) { - err = malloc(strlen(strerror(saveErrno)) + strlen(str) + 2 + 1); - if (!err) - return; - sprintf(err, "%s: ", str); - strcat(err, strerror(saveErrno)); + const char *err = strerror(errno); + + if (str) + LogWrite(-1, "%s: %s", str, err); + else LogWrite(-1, "%s", err); - free(err); - } else - LogWrite(-1, "%s", strerror(saveErrno)); } void -- cgit v1.2.3