xorg-server:

- update patch xserver-boottime.diff
This commit is contained in:
Stephan Raue 2010-02-07 21:08:23 +01:00
parent dde4f4d094
commit 89a5f6bf40

View File

@ -1,8 +1,7 @@
diff --git a/os/log.c b/os/log.c
index 0860847..2c46f1a 100644
--- a/os/log.c
+++ b/os/log.c
@@ -255,6 +255,33 @@ LogVWrite(int verb, const char *f, va_list args)
diff -Nurb xorg-server-1.7.3.orig/os/log.c xorg-server-1.7.3/os/log.c
--- xorg-server-1.7.3.orig/os/log.c 2009-10-27 23:56:24.000000000 -0700
+++ xorg-server-1.7.3/os/log.c 2010-01-26 11:26:25.683679988 -0800
@@ -259,6 +259,36 @@
static char tmpBuffer[1024];
int len = 0;
@ -10,6 +9,7 @@ index 0860847..2c46f1a 100644
+ time_t tv_sec;
+ suseconds_t tv_usec;
+ static Bool first = TRUE;
+ static Bool newline = TRUE;
+ static time_t start_tv_sec;
+ static suseconds_t start_usec;
+ int diff_sec, diff_usec;
@ -18,21 +18,31 @@ index 0860847..2c46f1a 100644
+ tv_sec = time.tv_sec;
+ tv_usec = time.tv_usec;
+ if (first == TRUE) {
+ start_tv_sec = tv_sec;
+ start_usec = tv_usec;
+ first = FALSE;
+ start_tv_sec = tv_sec;
+ start_usec = tv_usec;
+ first = FALSE;
+ }
+ diff_sec = (int)difftime(tv_sec, start_tv_sec);
+ diff_usec = (tv_usec - start_usec);
+ if (diff_usec < 0) {
+ diff_sec--;
+ diff_usec += 1000000;
+ diff_sec--;
+ diff_usec += 1000000;
+ }
+ if (newline) {
+ sprintf(tmpBuffer, "[%d.%03d] ", diff_sec , diff_usec / 1000);
+ len = strlen(tmpBuffer);
+ if (logFile)
+ fwrite(tmpBuffer, len, 1, logFile);
+ }
+ sprintf(tmpBuffer, "[%d sec: %06d usec]", diff_sec , diff_usec);
+ len = strlen(tmpBuffer);
+ if (logFile)
+ fwrite(tmpBuffer, len, 1, logFile);
+
/*
* Since a va_list can only be processed once, write the string to a
* buffer, and then write the buffer out to the appropriate output
@@ -268,6 +298,7 @@
vsnprintf(tmpBuffer, sizeof(tmpBuffer), f, args);
len = strlen(tmpBuffer);
}
+ newline = (tmpBuffer[len-1] == '\n');
if ((verb < 0 || logVerbosity >= verb) && len > 0)
fwrite(tmpBuffer, len, 1, stderr);
if ((verb < 0 || logFileVerbosity >= verb) && len > 0) {