Show
Ignore:
Timestamp:
05/12/10 21:31:27 (3 years ago)
Author:
ahu
Message:

fix up dnsgram compilation - spotted by David Hawthorne

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/dnsgram.cc

    r1472 r1609  
    1717StatBag S; 
    1818 
     19struct tm* pdns_localtime_r(const uint32_t* then, struct tm* tm) 
     20{ 
     21  time_t t = *then; 
     22   
     23  return localtime_r(&t, tm); 
     24} 
     25 
    1926int32_t g_clientQuestions, g_clientResponses, g_serverQuestions, g_serverResponses, g_skipped; 
    20 struct timeval g_lastanswerTime, g_lastquestionTime; 
    21 void makeReport(const struct timeval& tv) 
     27struct pdns_timeval g_lastanswerTime, g_lastquestionTime; 
     28void makeReport(const struct pdns_timeval& tv) 
    2229{ 
    2330  int64_t clientdiff = g_clientQuestions - g_clientResponses; 
     
    2633  if(clientdiff > 5 && clientdiff > 0.02*g_clientQuestions) { 
    2734    char tmp[80]; 
    28     struct tm tm=*localtime_r(&tv.tv_sec, &tm); 
     35    struct tm tm=*pdns_localtime_r(&tv.tv_sec, &tm); 
    2936    strftime(tmp, sizeof(tmp) - 1, "%F %H:%M:%S", &tm); 
    3037 
     
    3239         << g_clientQuestions <<" vs " << g_clientResponses << "), diff: " <<clientdiff<<endl; 
    3340 
    34     tm=*localtime_r(&g_lastanswerTime.tv_sec, &tm); 
     41    tm=*pdns_localtime_r(&g_lastanswerTime.tv_sec, &tm); 
    3542    strftime(tmp, sizeof(tmp) - 1, "%F %H:%M:%S", &tm); 
    3643     
    3744    cout<<"Last answer: "<<tmp<<"."<<g_lastanswerTime.tv_usec/1000000.0<<endl; 
    3845 
    39     tm=*localtime_r(&g_lastquestionTime.tv_sec, &tm); 
     46    tm=*pdns_localtime_r(&g_lastquestionTime.tv_sec, &tm); 
    4047    strftime(tmp, sizeof(tmp) - 1, "%F %H:%M:%S", &tm); 
    4148     
     
    4552  if(serverdiff > 5 && serverdiff > 0.02*g_serverQuestions) { 
    4653    char tmp[80]; 
    47     struct tm tm=*localtime_r(&tv.tv_sec, &tm); 
     54    struct tm tm=*pdns_localtime_r(&tv.tv_sec, &tm); 
    4855    strftime(tmp, sizeof(tmp) - 1, "%F %H:%M:%S", &tm); 
    4956 
     
    5158         << g_serverQuestions <<" vs " << g_serverResponses << "), diff: " <<serverdiff<<endl; 
    5259 
    53     tm=*localtime_r(&g_lastanswerTime.tv_sec, &tm); 
     60    tm=*pdns_localtime_r(&g_lastanswerTime.tv_sec, &tm); 
    5461    strftime(tmp, sizeof(tmp) - 1, "%F %H:%M:%S", &tm); 
    5562     
    5663    cout<<"Last answer: "<<tmp<<"."<<g_lastanswerTime.tv_usec/1000000.0<<endl; 
    5764 
    58     tm=*localtime_r(&g_lastquestionTime.tv_sec, &tm); 
     65    tm=*pdns_localtime_r(&g_lastquestionTime.tv_sec, &tm); 
    5966    strftime(tmp, sizeof(tmp) - 1, "%F %H:%M:%S", &tm); 
    6067     
     
    8996    /* report chunked */ 
    9097     
    91     struct timeval lastreport={0, 0}; 
     98    struct pdns_timeval lastreport={0, 0}; 
    9299     
    93100    typedef set<pair<string, uint16_t> > queries_t;