aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/os/log.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-03-26 14:23:28 +0200
committermarha <marha@users.sourceforge.net>2012-03-26 14:23:28 +0200
commit76bcc36ed305418a3ddc5752d287ede894243e1b (patch)
treebacb320c825768471ce56f058f17ce863d592376 /xorg-server/os/log.c
parent7d894e32566b710952c44cbc71939ad1d9e2fa8d (diff)
parent0f834b91a4768673833ab4917e87d86c237bb1a6 (diff)
downloadvcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.tar.gz
vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.tar.bz2
vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.zip
Merge remote-tracking branch 'origin/released'
Conflicts: pixman/pixman/pixman-mmx.c xorg-server/Xext/shm.c xorg-server/Xext/syncsrv.h xorg-server/Xext/xvmain.c xorg-server/Xi/exevents.c xorg-server/Xi/opendev.c xorg-server/composite/compalloc.c xorg-server/composite/compoverlay.c xorg-server/dix/colormap.c xorg-server/dix/devices.c xorg-server/dix/dispatch.c xorg-server/dix/dixfonts.c xorg-server/dix/eventconvert.c xorg-server/dix/events.c xorg-server/dix/gc.c xorg-server/dix/getevents.c xorg-server/dix/main.c xorg-server/dix/privates.c xorg-server/dix/registry.c xorg-server/dix/resource.c xorg-server/exa/exa_accel.c xorg-server/exa/exa_migration_classic.c xorg-server/exa/exa_unaccel.c xorg-server/fb/fb.h xorg-server/fb/fbcopy.c xorg-server/fb/fbpixmap.c xorg-server/glx/dispatch.h xorg-server/glx/glapi.h xorg-server/glx/glapi_gentable.c xorg-server/glx/glapitable.h xorg-server/glx/glprocs.h xorg-server/glx/glxcmds.c xorg-server/glx/glxcmdsswap.c xorg-server/glx/glxdricommon.c xorg-server/glx/glxdriswrast.c xorg-server/glx/glxext.c xorg-server/glx/indirect_dispatch.c xorg-server/glx/indirect_dispatch.h xorg-server/glx/indirect_dispatch_swap.c xorg-server/glx/indirect_size.h xorg-server/glx/indirect_size_get.h xorg-server/glx/indirect_table.c xorg-server/glx/indirect_util.c xorg-server/glx/rensize.c xorg-server/glx/single2swap.c xorg-server/glx/singlepix.c xorg-server/glx/singlepixswap.c xorg-server/glx/singlesize.c xorg-server/hw/dmx/dmxinit.c xorg-server/hw/kdrive/ephyr/ephyr.c xorg-server/hw/kdrive/ephyr/hostx.c xorg-server/hw/kdrive/ephyr/hostx.h xorg-server/hw/kdrive/src/kinput.c xorg-server/hw/xfree86/common/compiler.h xorg-server/hw/xwin/InitInput.c xorg-server/hw/xwin/InitOutput.c xorg-server/hw/xwin/ddraw.h xorg-server/hw/xwin/glx/glwrap.c xorg-server/hw/xwin/glx/indirect.c xorg-server/hw/xwin/glx/wgl_ext_api.h xorg-server/hw/xwin/glx/winpriv.c xorg-server/hw/xwin/win.h xorg-server/hw/xwin/winallpriv.c xorg-server/hw/xwin/winauth.c xorg-server/hw/xwin/winclipboard.h xorg-server/hw/xwin/winclipboardinit.c xorg-server/hw/xwin/winclipboardthread.c xorg-server/hw/xwin/winclipboardunicode.c xorg-server/hw/xwin/winclipboardwndproc.c xorg-server/hw/xwin/winclipboardwrappers.c xorg-server/hw/xwin/winclipboardxevents.c xorg-server/hw/xwin/wincmap.c xorg-server/hw/xwin/winconfig.c xorg-server/hw/xwin/wincreatewnd.c xorg-server/hw/xwin/wincursor.c xorg-server/hw/xwin/windialogs.c xorg-server/hw/xwin/winengine.c xorg-server/hw/xwin/winerror.c xorg-server/hw/xwin/wingc.c xorg-server/hw/xwin/wingetsp.c xorg-server/hw/xwin/winkeybd.c xorg-server/hw/xwin/winkeybd.h xorg-server/hw/xwin/winlayouts.h xorg-server/hw/xwin/winmisc.c xorg-server/hw/xwin/winmonitors.c xorg-server/hw/xwin/winmouse.c xorg-server/hw/xwin/winmsg.c xorg-server/hw/xwin/winmsg.h xorg-server/hw/xwin/winmultiwindowclass.c xorg-server/hw/xwin/winmultiwindowicons.c xorg-server/hw/xwin/winmultiwindowshape.c xorg-server/hw/xwin/winmultiwindowwindow.c xorg-server/hw/xwin/winmultiwindowwm.c xorg-server/hw/xwin/winmultiwindowwndproc.c xorg-server/hw/xwin/winnativegdi.c xorg-server/hw/xwin/winpfbdd.c xorg-server/hw/xwin/winpixmap.c xorg-server/hw/xwin/winpolyline.c xorg-server/hw/xwin/winprefs.c xorg-server/hw/xwin/winprocarg.c xorg-server/hw/xwin/winregistry.c xorg-server/hw/xwin/winscrinit.c xorg-server/hw/xwin/winsetsp.c xorg-server/hw/xwin/winshaddd.c xorg-server/hw/xwin/winshadddnl.c xorg-server/hw/xwin/winshadgdi.c xorg-server/hw/xwin/wintrayicon.c xorg-server/hw/xwin/winwin32rootless.c xorg-server/hw/xwin/winwin32rootlesswindow.c xorg-server/hw/xwin/winwin32rootlesswndproc.c xorg-server/hw/xwin/winwindow.c xorg-server/hw/xwin/winwindow.h xorg-server/hw/xwin/winwindowswm.c xorg-server/hw/xwin/winwndproc.c xorg-server/include/callback.h xorg-server/include/dixstruct.h xorg-server/include/misc.h xorg-server/include/os.h xorg-server/include/scrnintstr.h xorg-server/mi/micmap.c xorg-server/mi/miinitext.c xorg-server/mi/mioverlay.c xorg-server/mi/misprite.c xorg-server/mi/mivaltree.c xorg-server/mi/miwindow.c xorg-server/miext/damage/damage.c xorg-server/miext/rootless/rootlessGC.c xorg-server/miext/rootless/rootlessWindow.c xorg-server/os/WaitFor.c xorg-server/os/access.c xorg-server/os/connection.c xorg-server/os/io.c xorg-server/os/log.c xorg-server/os/osinit.c xorg-server/os/utils.c xorg-server/os/xdmcp.c xorg-server/os/xprintf.c xorg-server/os/xstrans.c xorg-server/render/mipict.c xorg-server/xkb/xkbActions.c xorg-server/xkb/xkbInit.c xorg-server/xkeyboard-config/compat/default.in
Diffstat (limited to 'xorg-server/os/log.c')
-rw-r--r--xorg-server/os/log.c311
1 files changed, 160 insertions, 151 deletions
diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c
index cf0e01518..ca29442f8 100644
--- a/xorg-server/os/log.c
+++ b/xorg-server/os/log.c
@@ -24,7 +24,6 @@ not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
-
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
Copyright 1994 Quarterdeck Office Systems.
@@ -76,7 +75,6 @@ OR PERFORMANCE OF THIS SOFTWARE.
* authorization from the copyright holder(s) and author(s).
*/
-
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
@@ -86,7 +84,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include <time.h>
#include <sys/stat.h>
#include <stdarg.h>
-#include <stdlib.h> /* for malloc() */
+#include <stdlib.h> /* for malloc() */
#include "input.h"
#include "site.h"
@@ -112,7 +110,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
#endif
#ifdef DDXOSVERRORF
-void (*OsVendorVErrorFProc)(const char *, va_list args) = NULL;
+void (*OsVendorVErrorFProc) (const char *, va_list args) = NULL;
#endif
static FILE *logFile = NULL;
@@ -129,13 +127,15 @@ static Bool needBuffer = TRUE;
#ifdef __APPLE__
#include <AvailabilityMacros.h>
-static char __crashreporter_info_buff__[4096] = {0};
-static const char *__crashreporter_info__ __attribute__((__used__)) = &__crashreporter_info_buff__[0];
+static char __crashreporter_info_buff__[4096] = { 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
// just tells the linker to never strip this symbol (such as for space optimization)
-asm (".desc ___crashreporter_info__, 0x10");
+asm(".desc ___crashreporter_info__, 0x10");
#endif
#endif
@@ -170,6 +170,9 @@ asm (".desc ___crashreporter_info__, 0x10");
#ifndef X_NOT_IMPLEMENTED_STRING
#define X_NOT_IMPLEMENTED_STRING "(NI)"
#endif
+#ifndef X_DEBUG_STRING
+#define X_DEBUG_STRING "(DB)"
+#endif
#ifndef X_NONE_STRING
#define X_NONE_STRING ""
#endif
@@ -189,39 +192,39 @@ LogInit(const char *fname, const char *backup)
char *logFileName = NULL;
if (fname && *fname) {
- if (asprintf(&logFileName, fname, display) == -1)
- FatalError("Cannot allocate space for the log file name\n");
-
- if (backup && *backup) {
- struct stat buf;
-
- if (!stat(logFileName, &buf) && S_ISREG(buf.st_mode)) {
- char *suffix;
- char *oldLog;
-
- if ((asprintf(&suffix, backup, display) == -1) ||
- (asprintf(&oldLog, "%s%s", logFileName, suffix) == -1))
- FatalError("Cannot allocate space for the log file name\n");
- free(suffix);
- if (rename(logFileName, oldLog) == -1) {
- FatalError("Cannot move old log file \"%s\" to \"%s\"\n",
- logFileName, oldLog);
- }
- free(oldLog);
- }
- }
- if ((logFile = fopen(logFileName, "w")) == NULL)
- FatalError("Cannot open log file \"%s\"\n", logFileName);
- setvbuf(logFile, NULL, _IONBF, 0);
-
- /* Flush saved log information. */
- if (saveBuffer && bufferSize > 0) {
- fwrite(saveBuffer, bufferPos, 1, logFile);
- fflush(logFile);
+ if (asprintf(&logFileName, fname, display) == -1)
+ FatalError("Cannot allocate space for the log file name\n");
+
+ if (backup && *backup) {
+ struct stat buf;
+
+ if (!stat(logFileName, &buf) && S_ISREG(buf.st_mode)) {
+ char *suffix;
+ char *oldLog;
+
+ if ((asprintf(&suffix, backup, display) == -1) ||
+ (asprintf(&oldLog, "%s%s", logFileName, suffix) == -1))
+ FatalError("Cannot allocate space for the log file name\n");
+ free(suffix);
+ if (rename(logFileName, oldLog) == -1) {
+ FatalError("Cannot move old log file \"%s\" to \"%s\"\n",
+ logFileName, oldLog);
+ }
+ free(oldLog);
+ }
+ }
+ if ((logFile = fopen(logFileName, "w")) == NULL)
+ FatalError("Cannot open log file \"%s\"\n", logFileName);
+ setvbuf(logFile, NULL, _IONBF, 0);
+
+ /* Flush saved log information. */
+ if (saveBuffer && bufferSize > 0) {
+ fwrite(saveBuffer, bufferPos, 1, logFile);
+ fflush(logFile);
#ifndef WIN32
- fsync(fileno(logFile));
+ fsync(fileno(logFile));
#endif
- }
+ }
}
/*
@@ -229,9 +232,9 @@ LogInit(const char *fname, const char *backup)
* needed.
*/
if (saveBuffer && bufferSize > 0) {
- free(saveBuffer); /* Must be free(), not free() */
- saveBuffer = NULL;
- bufferSize = 0;
+ free(saveBuffer); /* Must be free(), not free() */
+ saveBuffer = NULL;
+ bufferSize = 0;
}
needBuffer = FALSE;
@@ -242,10 +245,10 @@ void
LogClose(enum ExitCode error)
{
if (logFile) {
- ErrorF("Server terminated %s (%d). Closing log file.\n",
- (error == EXIT_NO_ERROR) ? "successfully" : "with error", error);
- fclose(logFile);
- logFile = NULL;
+ ErrorF("Server terminated %s (%d). Closing log file.\n",
+ (error == EXIT_NO_ERROR) ? "successfully" : "with error", error);
+ fclose(logFile);
+ logFile = NULL;
}
}
@@ -254,19 +257,19 @@ LogSetParameter(LogParameter param, int value)
{
switch (param) {
case XLOG_FLUSH:
- logFlush = value ? TRUE : FALSE;
- return TRUE;
+ logFlush = value ? TRUE : FALSE;
+ return TRUE;
case XLOG_SYNC:
- logSync = value ? TRUE : FALSE;
- return TRUE;
+ logSync = value ? TRUE : FALSE;
+ return TRUE;
case XLOG_VERBOSITY:
- logVerbosity = value;
- return TRUE;
+ logVerbosity = value;
+ return TRUE;
case XLOG_FILE_VERBOSITY:
- logFileVerbosity = value;
- return TRUE;
+ logFileVerbosity = value;
+ return TRUE;
default:
- return FALSE;
+ return FALSE;
}
}
@@ -280,10 +283,10 @@ LogVWrite(int verb, const char *f, va_list args)
static Bool newline = TRUE;
if (newline) {
- sprintf(tmpBuffer, "[%10.3f] ", GetTimeInMillis() / 1000.0);
- len = strlen(tmpBuffer);
- if (logFile)
- fwrite(tmpBuffer, len, 1, logFile);
+ sprintf(tmpBuffer, "[%10.3f] ", GetTimeInMillis() / 1000.0);
+ len = strlen(tmpBuffer);
+ if (logFile)
+ fwrite(tmpBuffer, len, 1, logFile);
}
/*
@@ -292,35 +295,36 @@ LogVWrite(int verb, const char *f, va_list args)
* stream(s).
*/
if (verb < 0 || logFileVerbosity >= verb || logVerbosity >= verb) {
- vsnprintf(tmpBuffer, sizeof(tmpBuffer)-1, f, args);
+ vsnprintf(tmpBuffer, sizeof(tmpBuffer)-1, f, args);
tmpBuffer[sizeof(tmpBuffer)-1]=0;
- len = strlen(tmpBuffer);
+ len = strlen(tmpBuffer);
}
- newline = (tmpBuffer[len-1] == '\n');
+ newline = (tmpBuffer[len - 1] == '\n');
if ((verb < 0 || logVerbosity >= verb) && len > 0)
- fwrite(tmpBuffer, len, 1, stderr);
+ fwrite(tmpBuffer, len, 1, stderr);
if ((verb < 0 || logFileVerbosity >= verb) && len > 0) {
- if (logFile) {
- fwrite(tmpBuffer, len, 1, logFile);
- if (logFlush) {
- fflush(logFile);
+ if (logFile) {
+ fwrite(tmpBuffer, len, 1, logFile);
+ if (logFlush) {
+ fflush(logFile);
#ifndef WIN32
- if (logSync)
- fsync(fileno(logFile));
+ if (logSync)
+ fsync(fileno(logFile));
#endif
- }
- } else if (needBuffer) {
- if (len > bufferUnused) {
- bufferSize += 1024;
- bufferUnused += 1024;
- saveBuffer = realloc(saveBuffer, bufferSize);
- if (!saveBuffer)
- FatalError("realloc() failed while saving log messages\n");
- }
- bufferUnused -= len;
- memcpy(saveBuffer + bufferPos, tmpBuffer, len);
- bufferPos += len;
- }
+ }
+ }
+ else if (needBuffer) {
+ if (len > bufferUnused) {
+ bufferSize += 1024;
+ bufferUnused += 1024;
+ saveBuffer = realloc(saveBuffer, bufferSize);
+ if (!saveBuffer)
+ FatalError("realloc() failed while saving log messages\n");
+ }
+ bufferUnused -= len;
+ memcpy(saveBuffer + bufferPos, tmpBuffer, len);
+ bufferPos += len;
+ }
}
}
@@ -340,36 +344,38 @@ static const char *
LogMessageTypeVerbString(MessageType type, int verb)
{
if (type == X_ERROR)
- verb = 0;
+ verb = 0;
if (logVerbosity < verb && logFileVerbosity < verb)
- return NULL;
+ return NULL;
switch (type) {
case X_PROBED:
- return X_PROBE_STRING;
+ return X_PROBE_STRING;
case X_CONFIG:
- return X_CONFIG_STRING;
+ return X_CONFIG_STRING;
case X_DEFAULT:
- return X_DEFAULT_STRING;
+ return X_DEFAULT_STRING;
case X_CMDLINE:
- return X_CMDLINE_STRING;
+ return X_CMDLINE_STRING;
case X_NOTICE:
- return X_NOTICE_STRING;
+ return X_NOTICE_STRING;
case X_ERROR:
- return X_ERROR_STRING;
+ return X_ERROR_STRING;
case X_WARNING:
- return X_WARNING_STRING;
+ return X_WARNING_STRING;
case X_INFO:
- return X_INFO_STRING;
+ return X_INFO_STRING;
case X_NOT_IMPLEMENTED:
- return X_NOT_IMPLEMENTED_STRING;
+ return X_NOT_IMPLEMENTED_STRING;
case X_UNKNOWN:
- return X_UNKNOWN_STRING;
+ return X_UNKNOWN_STRING;
case X_NONE:
- return X_NONE_STRING;
+ return X_NONE_STRING;
+ case X_DEBUG:
+ return X_DEBUG_STRING;
default:
- return X_UNKNOWN_STRING;
+ return X_UNKNOWN_STRING;
}
}
@@ -382,7 +388,7 @@ LogVMessageVerb(MessageType type, int verb, const char *format, va_list args)
type_str = LogMessageTypeVerbString(type, verb);
if (!type_str)
- return;
+ return;
/* if type_str is not "", prepend it and ' ', to format */
if (type_str[0] == '\0')
@@ -417,10 +423,9 @@ LogMessage(MessageType type, const char *format, ...)
va_end(ap);
}
-
void
LogVHdrMessageVerb(MessageType type, int verb, const char *msg_format,
- va_list msg_args, const char *hdr_format, va_list hdr_args)
+ va_list msg_args, const char *hdr_format, va_list hdr_args)
{
const char *type_str;
char tmpFormat[1024];
@@ -430,29 +435,29 @@ LogVHdrMessageVerb(MessageType type, int verb, const char *msg_format,
type_str = LogMessageTypeVerbString(type, verb);
if (!type_str)
- return;
+ return;
/* if type_str != "", copy it and ' ' to tmpFormat; set p after ' ' */
p = tmpFormat;
if (type_str[0] != '\0')
- p += snprintf(tmpFormat, sizeof(tmpFormat), "%s ", type_str);
+ p += snprintf(tmpFormat, sizeof(tmpFormat), "%s ", type_str);
/* append as much of hdr as fits after type_str (if there was one) */
left = tmpFormat_end - p;
if (left > 1)
- p += vsnprintf(p, left, hdr_format, hdr_args);
+ p += vsnprintf(p, left, hdr_format, hdr_args);
/* append as much of msg_format as will fit after hdr */
left = tmpFormat_end - p;
if (left > 1)
- snprintf(p, left, "%s", msg_format);
+ snprintf(p, left, "%s", msg_format);
LogVWrite(verb, tmpFormat, msg_args);
}
void
LogHdrMessageVerb(MessageType type, int verb, const char *msg_format,
- va_list msg_args, const char *hdr_format, ...)
+ va_list msg_args, const char *hdr_format, ...)
{
va_list hdr_args;
@@ -463,7 +468,7 @@ LogHdrMessageVerb(MessageType type, int verb, const char *msg_format,
void
LogHdrMessage(MessageType type, const char *msg_format, va_list msg_args,
- const char *hdr_format, ...)
+ const char *hdr_format, ...)
{
va_list hdr_args;
@@ -473,7 +478,8 @@ LogHdrMessage(MessageType type, const char *msg_format, va_list msg_args,
}
void
-AbortServer(void) _X_NORETURN;
+AbortServer(void)
+ _X_NORETURN;
void
AbortServer(void)
@@ -487,13 +493,13 @@ AbortServer(void)
AbortDDX(EXIT_ERR_ABORT);
fflush(stderr);
if (CoreDump)
- OsAbort();
- exit (1);
+ OsAbort();
+ exit(1);
}
#define AUDIT_PREFIX "AUDIT: %s: %ld: "
#ifndef AUDIT_TIMEOUT
-#define AUDIT_TIMEOUT ((CARD32)(120 * 1000)) /* 2 mn */
+#define AUDIT_TIMEOUT ((CARD32)(120 * 1000)) /* 2 mn */
#endif
static int nrepeat = 0;
@@ -504,10 +510,10 @@ void
FreeAuditTimer(void)
{
if (auditTimer != NULL) {
- /* Force output of pending messages */
- TimerForce(auditTimer);
- TimerFree(auditTimer);
- auditTimer = NULL;
+ /* Force output of pending messages */
+ TimerForce(auditTimer);
+ TimerFree(auditTimer);
+ auditTimer = NULL;
}
}
@@ -522,17 +528,17 @@ AuditPrefix(void)
time(&tm);
autime = ctime(&tm);
if ((s = strchr(autime, '\n')))
- *s = '\0';
+ *s = '\0';
len = strlen(AUDIT_PREFIX) + strlen(autime) + 10 + 1;
tmpBuf = malloc(len);
if (!tmpBuf)
- return NULL;
- snprintf(tmpBuf, len, AUDIT_PREFIX, autime, (unsigned long)getpid());
+ return NULL;
+ snprintf(tmpBuf, len, AUDIT_PREFIX, autime, (unsigned long) getpid());
return tmpBuf;
}
void
-AuditF(const char * f, ...)
+AuditF(const char *f, ...)
{
va_list args;
@@ -548,16 +554,17 @@ AuditFlush(OsTimerPtr timer, CARD32 now, pointer arg)
char *prefix;
if (nrepeat > 0) {
- prefix = AuditPrefix();
- ErrorF("%slast message repeated %d times\n",
- prefix != NULL ? prefix : "", nrepeat);
- nrepeat = 0;
- free(prefix);
- return AUDIT_TIMEOUT;
- } else {
- /* if the timer expires without anything to print, flush the message */
- oldlen = -1;
- return 0;
+ prefix = AuditPrefix();
+ ErrorF("%slast message repeated %d times\n",
+ prefix != NULL ? prefix : "", nrepeat);
+ nrepeat = 0;
+ free(prefix);
+ return AUDIT_TIMEOUT;
+ }
+ else {
+ /* if the timer expires without anything to print, flush the message */
+ oldlen = -1;
+ return 0;
}
}
@@ -573,17 +580,18 @@ VAuditF(const char *f, va_list args)
len = vsnprintf(buf, sizeof(buf), f, args);
if (len == oldlen && strcmp(buf, oldbuf) == 0) {
- /* Message already seen */
- nrepeat++;
- } else {
- /* new message */
- if (auditTimer != NULL)
- TimerForce(auditTimer);
- ErrorF("%s%s", prefix != NULL ? prefix : "", buf);
- strncpy(oldbuf, buf, sizeof(oldbuf));
- oldlen = len;
- nrepeat = 0;
- auditTimer = TimerSet(auditTimer, 0, AUDIT_TIMEOUT, AuditFlush, NULL);
+ /* Message already seen */
+ nrepeat++;
+ }
+ else {
+ /* new message */
+ if (auditTimer != NULL)
+ TimerForce(auditTimer);
+ ErrorF("%s%s", prefix != NULL ? prefix : "", buf);
+ strncpy(oldbuf, buf, sizeof(oldbuf));
+ oldlen = len;
+ nrepeat = 0;
+ auditTimer = TimerSet(auditTimer, 0, AUDIT_TIMEOUT, AuditFlush, NULL);
}
free(prefix);
}
@@ -597,16 +605,18 @@ FatalError(const char *f, ...)
static Bool beenhere = FALSE;
if (beenhere)
- ErrorF("\nFatalError re-entered, aborting\n");
+ ErrorF("\nFatalError re-entered, aborting\n");
else
- ErrorF("\nFatal server error:\n");
+ ErrorF("\nFatal server error:\n");
va_start(args, f);
#ifdef __APPLE__
{
va_list args2;
+
va_copy(args2, args);
- (void)vsnprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__), f, args2);
+ (void) vsnprintf(__crashreporter_info_buff__,
+ sizeof(__crashreporter_info_buff__), f, args2);
va_end(args2);
}
#endif
@@ -617,30 +627,30 @@ FatalError(const char *f, ...)
va_end(args);
ErrorF("\n");
if (!beenhere)
- OsVendorFatalError();
+ OsVendorFatalError();
if (!beenhere) {
- beenhere = TRUE;
- AbortServer();
- } else
- OsAbort();
- /*NOTREACHED*/
-}
+ beenhere = TRUE;
+ AbortServer();
+ }
+ else
+ OsAbort();
+ /*NOTREACHED*/}
void
VErrorF(const char *f, va_list args)
{
#ifdef DDXOSVERRORF
if (OsVendorVErrorFProc)
- OsVendorVErrorFProc(f, args);
+ OsVendorVErrorFProc(f, args);
else
- LogVWrite(-1, f, args);
+ LogVWrite(-1, f, args);
#else
LogVWrite(-1, f, args);
#endif
}
void
-ErrorF(const char * f, ...)
+ErrorF(const char *f, ...)
{
va_list args;
@@ -665,4 +675,3 @@ LogPrintMarkers(void)
LogMessageVerb(X_NOT_IMPLEMENTED, 0, "not implemented, ");
LogMessageVerb(X_UNKNOWN, 0, "unknown.\n");
}
-