diff options
Diffstat (limited to 'xorg-server/os/log.c')
-rw-r--r-- | xorg-server/os/log.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c index adcf16244..8d4dfc4ec 100644 --- a/xorg-server/os/log.c +++ b/xorg-server/os/log.c @@ -95,8 +95,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"
@@ -261,7 +267,7 @@ LogSetParameter(LogParameter param, int value) void
LogVWrite(int verb, const char *f, va_list args)
{
- static char tmpBuffer[1024];
+ char tmpBuffer[1024];
int len = 0;
static Bool newline = TRUE;
@@ -278,7 +284,8 @@ LogVWrite(int verb, const char *f, va_list args) * stream(s).
*/
if (verb < 0 || logFileVerbosity >= verb || logVerbosity >= verb) {
- vsnprintf(tmpBuffer, sizeof(tmpBuffer), f, args);
+ vsnprintf(tmpBuffer, sizeof(tmpBuffer)-1, f, args);
+ tmpBuffer[sizeof(tmpBuffer)-1]=0;
len = strlen(tmpBuffer);
}
newline = (tmpBuffer[len-1] == '\n');
@@ -511,6 +518,8 @@ VAuditF(const char *f, va_list args) free(prefix);
}
+extern char g_FatalErrorMessage[1024];
+
void
FatalError(const char *f, ...)
{
@@ -526,6 +535,9 @@ FatalError(const char *f, ...) #ifdef __APPLE__
(void)vsnprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__), f, args);
#endif
+#ifdef WIN32
+ vsnprintf(g_FatalErrorMessage, 1024, f, args);
+#endif
VErrorF(f, args);
va_end(args);
ErrorF("\n");
|