rev |
line source |
jozee@3327
|
1 diff --git xorg-server-1.5.3/os/log.c xorg-server-1.5.3/os/log.c
|
jozee@3327
|
2 index 0860847..2c46f1a 100644
|
jozee@3327
|
3 --- xorg-server-1.5.3/os/log.c
|
jozee@3327
|
4 +++ xorg-server-1.5.3/os/log.c
|
jozee@3327
|
5 @@ -255,6 +255,33 @@ LogVWrite(int verb, const char *f, va_list args)
|
jozee@3327
|
6 static char tmpBuffer[1024];
|
jozee@3327
|
7 int len = 0;
|
jozee@3327
|
8
|
jozee@3327
|
9 + struct timeval time;
|
jozee@3327
|
10 + time_t tv_sec;
|
jozee@3327
|
11 + suseconds_t tv_usec;
|
jozee@3327
|
12 + static Bool first = TRUE;
|
jozee@3327
|
13 + static time_t start_tv_sec;
|
jozee@3327
|
14 + static suseconds_t start_usec;
|
jozee@3327
|
15 + int diff_sec, diff_usec;
|
jozee@3327
|
16 +
|
jozee@3327
|
17 + gettimeofday(&time, NULL);
|
jozee@3327
|
18 + tv_sec = time.tv_sec;
|
jozee@3327
|
19 + tv_usec = time.tv_usec;
|
jozee@3327
|
20 + if (first == TRUE) {
|
jozee@3327
|
21 + start_tv_sec = tv_sec;
|
jozee@3327
|
22 + start_usec = tv_usec;
|
jozee@3327
|
23 + first = FALSE;
|
jozee@3327
|
24 + }
|
jozee@3327
|
25 + diff_sec = (int)difftime(tv_sec, start_tv_sec);
|
jozee@3327
|
26 + diff_usec = (tv_usec - start_usec);
|
jozee@3327
|
27 + if (diff_usec < 0) {
|
jozee@3327
|
28 + diff_sec--;
|
jozee@3327
|
29 + diff_usec += 1000000;
|
jozee@3327
|
30 + }
|
jozee@3327
|
31 + sprintf(tmpBuffer, "[%d sec: %06d usec]", diff_sec , diff_usec);
|
jozee@3327
|
32 + len = strlen(tmpBuffer);
|
jozee@3327
|
33 + if (logFile)
|
jozee@3327
|
34 + fwrite(tmpBuffer, len, 1, logFile);
|
jozee@3327
|
35 +
|
jozee@3327
|
36 /*
|
jozee@3327
|
37 * Since a va_list can only be processed once, write the string to a
|
jozee@3327
|
38 * buffer, and then write the buffer out to the appropriate output
|