Show
Ignore:
Timestamp:
04/30/06 14:55:38 (4 years ago)
Author:
ahu
Message:

implement 'netstringerror', to be called to report network errors

Files:
1 modified

Legend:

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

    r802 r812  
    329329} 
    330330 
     331#ifdef WIN32 
     332string netstringerror() 
     333{ 
     334  char buf[512]; 
     335  int err=WSAGetLastError(); 
     336  if(FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 
     337                     0, buf, sizeof(buf)-1, NULL)) { 
     338    return string(buf); 
     339  } 
     340  else { 
     341    return strerror(err); 
     342  } 
     343} 
     344#else 
     345string netstringerror() 
     346{ 
     347  return stringerror(); 
     348} 
     349#endif 
     350 
    331351void cleanSlashes(string &str) 
    332352{