From: Bert Hubert Date: Wed, 12 May 2010 19:31:27 +0000 (+0000) Subject: fix up dnsgram compilation - spotted by David Hawthorne X-Git-Tag: rec-3.3~93 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b6c31ee0e3b54c6b25045e6b84611db34b3e454c;p=pdns fix up dnsgram compilation - spotted by David Hawthorne git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1609 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/Makefile.am b/pdns/Makefile.am index 9855c60c4..220399751 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -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 \ diff --git a/pdns/dnsgram.cc b/pdns/dnsgram.cc index 2a5cfc09c..b7f41238c 100644 --- a/pdns/dnsgram.cc +++ b/pdns/dnsgram.cc @@ -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: " < 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: " < > queries_t; queries_t questions, answers;