diff options
author | marha <marha@users.sourceforge.net> | 2010-12-07 15:49:06 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-12-07 15:49:06 +0000 |
commit | 25b9dbb15f0dc98cfc6b5585e7efebf3250f64d3 (patch) | |
tree | 93007a6f77999699b0077f448c08b3d505662f55 /xorg-server/os/log.c | |
parent | c82036153f9273a6041426fb98e69fff0806680e (diff) | |
download | vcxsrv-25b9dbb15f0dc98cfc6b5585e7efebf3250f64d3.tar.gz vcxsrv-25b9dbb15f0dc98cfc6b5585e7efebf3250f64d3.tar.bz2 vcxsrv-25b9dbb15f0dc98cfc6b5585e7efebf3250f64d3.zip |
xserver pixman git update 7-12-2010
Diffstat (limited to 'xorg-server/os/log.c')
-rw-r--r-- | xorg-server/os/log.c | 21 |
1 files changed, 7 insertions, 14 deletions
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 <AvailabilityMacros.h>
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
|