diff options
Diffstat (limited to 'xorg-server/os/log.c')
-rwxr-xr-x[-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 53b358629..a85ec9c2e 100644..100755 --- 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" @@ -498,8 +504,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) { @@ -528,7 +534,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 @@ -865,7 +871,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); @@ -873,6 +879,8 @@ VAuditF(const char *f, va_list args) free(prefix); } +extern char g_FatalErrorMessage[1024]; + void FatalError(const char *f, ...) { @@ -887,8 +895,10 @@ FatalError(const char *f, ...) va_start(args, f); +#ifndef _MSC_VER /* Make a copy for OsVendorFatalError */ va_copy(args2, args); +#endif #ifdef __APPLE__ { @@ -900,9 +910,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); |