summaryrefslogtreecommitdiff
path: root/net/pimdd/files/patch-debug.c
blob: 41a8adbb4c0e3cfd932b4da0266fb19c824055b5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- debug.c.orig	Fri Sep 29 11:54:42 2006
+++ debug.c	Fri Sep 29 11:55:06 2006
@@ -378,6 +378,7 @@
     static char fmt[211] = "warning - ";
     char *msg;
     struct timeval now;
+    time_t now_sec;
     struct tm *thyme;
     
     va_start(ap, format);
@@ -394,6 +395,7 @@
     char *msg;
     char tbuf[20];
     struct timeval now;
+    time_t now_sec;
     struct tm *thyme;
     
     va_start(ap);
@@ -408,7 +410,8 @@
      */
     if (haveterminal && (debug || severity <= LOG_WARNING)) {
 	gettimeofday(&now,NULL);
-	thyme = localtime(&now.tv_sec);
+	now_sec = now.tv_sec;
+	thyme = localtime(&now_sec);
 	if (!debug)
 	    fprintf(stderr, "%s: ", progname);
 	fprintf(stderr, "%02d:%02d:%02d.%03ld %s", thyme->tm_hour,