Index: trunk/pdns/pdns/dnsgram.cc
===================================================================
--- trunk/pdns/pdns/dnsgram.cc	(revision 1472)
+++ trunk/pdns/pdns/dnsgram.cc	(revision 1609)
@@ -17,7 +17,14 @@
 StatBag S;
 
+struct tm* pdns_localtime_r(const uint32_t* then, struct tm* tm)
+{
+  time_t t = *then;
+  
+  return localtime_r(&t, tm);
+}
+
 int32_t g_clientQuestions, g_clientResponses, g_serverQuestions, g_serverResponses, g_skipped;
-struct timeval g_lastanswerTime, g_lastquestionTime;
-void makeReport(const struct timeval& tv)
+struct pdns_timeval g_lastanswerTime, g_lastquestionTime;
+void makeReport(const struct pdns_timeval& tv)
 {
   int64_t clientdiff = g_clientQuestions - g_clientResponses;
@@ -26,5 +33,5 @@
   if(clientdiff > 5 && clientdiff > 0.02*g_clientQuestions) {
     char tmp[80];
-    struct tm tm=*localtime_r(&tv.tv_sec, &tm);
+    struct tm tm=*pdns_localtime_r(&tv.tv_sec, &tm);
     strftime(tmp, sizeof(tmp) - 1, "%F %H:%M:%S", &tm);
 
@@ -32,10 +39,10 @@
          << g_clientQuestions <<" vs " << g_clientResponses << "), diff: " <<clientdiff<<endl;
 
-    tm=*localtime_r(&g_lastanswerTime.tv_sec, &tm);
+    tm=*pdns_localtime_r(&g_lastanswerTime.tv_sec, &tm);
     strftime(tmp, sizeof(tmp) - 1, "%F %H:%M:%S", &tm);
     
     cout<<"Last answer: "<<tmp<<"."<<g_lastanswerTime.tv_usec/1000000.0<<endl;
 
-    tm=*localtime_r(&g_lastquestionTime.tv_sec, &tm);
+    tm=*pdns_localtime_r(&g_lastquestionTime.tv_sec, &tm);
     strftime(tmp, sizeof(tmp) - 1, "%F %H:%M:%S", &tm);
     
@@ -45,5 +52,5 @@
   if(serverdiff > 5 && serverdiff > 0.02*g_serverQuestions) {
     char tmp[80];
-    struct tm tm=*localtime_r(&tv.tv_sec, &tm);
+    struct tm tm=*pdns_localtime_r(&tv.tv_sec, &tm);
     strftime(tmp, sizeof(tmp) - 1, "%F %H:%M:%S", &tm);
 
@@ -51,10 +58,10 @@
          << g_serverQuestions <<" vs " << g_serverResponses << "), diff: " <<serverdiff<<endl;
 
-    tm=*localtime_r(&g_lastanswerTime.tv_sec, &tm);
+    tm=*pdns_localtime_r(&g_lastanswerTime.tv_sec, &tm);
     strftime(tmp, sizeof(tmp) - 1, "%F %H:%M:%S", &tm);
     
     cout<<"Last answer: "<<tmp<<"."<<g_lastanswerTime.tv_usec/1000000.0<<endl;
 
-    tm=*localtime_r(&g_lastquestionTime.tv_sec, &tm);
+    tm=*pdns_localtime_r(&g_lastquestionTime.tv_sec, &tm);
     strftime(tmp, sizeof(tmp) - 1, "%F %H:%M:%S", &tm);
     
@@ -89,5 +96,5 @@
     /* report chunked */
     
-    struct timeval lastreport={0, 0};
+    struct pdns_timeval lastreport={0, 0};
     
     typedef set<pair<string, uint16_t> > queries_t;
