diff options
Diffstat (limited to 'xorg-server/os/log.c')
-rw-r--r-- | xorg-server/os/log.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c index 38193eed6..67c27eefa 100644 --- a/xorg-server/os/log.c +++ b/xorg-server/os/log.c @@ -92,8 +92,14 @@ OR PERFORMANCE OF THIS SOFTWARE. #ifdef WIN32 #include <process.h> +#ifndef _MSC_VER #define getpid(x) _getpid(x) #endif +#endif + +#ifdef _MSC_VER +#define S_ISREG(m) (((m)&_S_IFMT) == _S_IFREG) +#endif #ifdef XF86BIGFONT #include "xf86bigfontsrv.h" @@ -504,8 +510,8 @@ LogSWrite(int verb, const char *buf, size_t len, Bool end_line) #endif } else if (!inSignalContext && logFile) { - if (newline) - fprintf(logFile, "[%10.3f] ", GetTimeInMillis() / 1000.0); +// if (newline) +// fprintf(logFile, "[%10.3f] ", GetTimeInMillis() / 1000.0); newline = end_line; fwrite(buf, len, 1, logFile); if (logFlush) { @@ -534,7 +540,7 @@ LogSWrite(int verb, const char *buf, size_t len, Bool end_line) void LogVWrite(int verb, const char *f, va_list args) { - return LogVMessageVerb(X_NONE, verb, f, args); + LogVMessageVerb(X_NONE, verb, f, args); } void @@ -871,7 +877,7 @@ VAuditF(const char *f, va_list args) if (auditTimer != NULL) TimerForce(auditTimer); ErrorF("%s%s", prefix != NULL ? prefix : "", buf); - strlcpy(oldbuf, buf, sizeof(oldbuf)); + strncpy(oldbuf, buf, sizeof(oldbuf)); oldlen = len; nrepeat = 0; auditTimer = TimerSet(auditTimer, 0, AUDIT_TIMEOUT, AuditFlush, NULL); @@ -879,6 +885,8 @@ VAuditF(const char *f, va_list args) free(prefix); } +extern char g_FatalErrorMessage[1024]; + void FatalError(const char *f, ...) { @@ -893,8 +901,10 @@ FatalError(const char *f, ...) va_start(args, f); +#ifndef _MSC_VER /* Make a copy for OsVendorFatalError */ va_copy(args2, args); +#endif #ifdef __APPLE__ { @@ -906,9 +916,15 @@ FatalError(const char *f, ...) va_end(apple_args); } #endif +#ifdef WIN32 + vsnprintf(g_FatalErrorMessage, 1024, f, args); +#endif VErrorFSigSafe(f, args); va_end(args); ErrorFSigSafe("\n"); +#ifdef _MSC_VER + va_start(args2, f); +#endif if (!beenhere) OsVendorFatalError(f, args2); va_end(args2); |