]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
fix up dnsgram compilation - spotted by David Hawthorne
authorBert Hubert <bert.hubert@netherlabs.nl>
Wed, 12 May 2010 19:31:27 +0000 (19:31 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Wed, 12 May 2010 19:31:27 +0000 (19:31 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1609 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/Makefile.am
pdns/dnsgram.cc

index 9855c60c4eb99f880e6e9cdddbc31099dd3599e0..2203997513002e74a6694d4773f85b22f6500c35 100644 (file)
@@ -139,8 +139,7 @@ dnsscope_LDFLAGS= @DYNLINKFLAGS@ @THREADFLAGS@
 dnsgram_SOURCES=dnsgram.cc misc.cc unix_utility.cc qtype.cc \
        logger.cc statbag.cc  dnspcap.cc dnspcap.hh dnsparser.cc dnsrecords.cc \
        base64.cc base64.hh dnswriter.cc dnswriter.hh rcpgenerator.cc rcpgenerator.hh \
-       utility.hh dnsparser.hh sillyrecords.cc
-
+       utility.hh dnsparser.hh sillyrecords.cc nsecrecords.cc base32.cc
 
 dnsdemog_SOURCES=dnsdemog.cc misc.cc unix_utility.cc qtype.cc \
        logger.cc statbag.cc  dnspcap.cc dnspcap.hh dnsparser.cc dnsrecords.cc \
index 2a5cfc09c2a0af0632c886660df6dd492a4626a8..b7f41238c12ca7e5df16added23a60f2fba2cdbe 100644 (file)
@@ -16,27 +16,34 @@ using namespace std;
 
 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;
   int64_t serverdiff = g_serverQuestions - g_serverResponses;
 
   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);
 
     cout << tmp << ": Resolver dropped too many questions (" 
          << 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);
     
     cout<<"Last question: "<<tmp<<"."<<g_lastquestionTime.tv_usec/1000000.0<<endl;
@@ -44,18 +51,18 @@ void makeReport(const struct timeval& tv)
 
   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);
 
     cout << tmp << ": Auth server dropped too many questions (" 
          << 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);
     
     cout<<"Last question: "<<tmp<<"."<<g_lastquestionTime.tv_usec/1000000.0<<endl;
@@ -88,7 +95,7 @@ try
     /* we measure every 60 seconds, each interval with 10% less answers than questions is interesting */
     /* report chunked */
     
-    struct timeval lastreport={0, 0};
+    struct pdns_timeval lastreport={0, 0};
     
     typedef set<pair<string, uint16_t> > queries_t;
     queries_t questions, answers;