diff options
Diffstat (limited to 'xorg-server/os/log.c')
-rw-r--r-- | xorg-server/os/log.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c index 20cd74af6..02267638f 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
#define _XF86BIGFONT_SERVER_
@@ -256,7 +262,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;
@@ -273,7 +279,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');
|