Changeset 1055
- Timestamp:
- 06/07/07 23:04:09 (1 year ago)
- Files:
-
- trunk/pdns/pdns/backends/bind/zone2sql.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/pdns/pdns/backends/bind/zone2sql.cc
r1018 r1055 42 42 #include "dnsrecords.hh" 43 43 #include <boost/algorithm/string.hpp> 44 #include <sys/types.h> 45 #include <sys/stat.h> 46 #include <unistd.h> 44 47 45 48 using namespace boost; … … 220 223 zonefile=arg()["zone"]; 221 224 222 int count=0 ;225 int count=0, num_domainsdone=0; 223 226 224 227 if(zonefile.empty()) { … … 227 230 BP.parse(namedfile.empty() ? "./named.conf" : namedfile); 228 231 229 const vector<BindDomainInfo> &domains=BP.getDomains(); 232 vector<BindDomainInfo> domains=BP.getDomains(); 233 struct stat st; 234 for(vector<BindDomainInfo>::iterator i=domains.begin(); i!=domains.end(); ++i) { 235 if(stat(i->filename.c_str(), &st) == 0) { 236 i->d_dev = st.st_dev; 237 i->d_ino = st.st_ino; 238 } 239 } 240 241 sort(domains.begin(), domains.end()); // put stuff in inode order 230 242 231 243 int numdomains=domains.size(); … … 274 286 while(zpt.get(rr)) 275 287 callback(0, rr.qname, rr.qtype.getName(), rr.content, rr.ttl, rr.priority); 288 num_domainsdone++; 276 289 } 290 catch(exception &ae) { 291 if(!arg().mustDo("on-error-resume-next")) 292 throw; 293 else 294 cerr<<endl<<ae.what()<<endl; 295 } 296 277 297 catch(AhuException &ae) { 278 298 if(!arg().mustDo("on-error-resume-next")) … … 294 314 while(zpt.get(rr)) 295 315 callback(0, rr.qname, rr.qtype.getName(), rr.content, rr.ttl, rr.priority); 296 297 } 298 cerr<< "Parsed "<<num_records<<" records"<<endl;316 num_domainsdone=1; 317 } 318 cerr<<num_domainsdone<<" domains were fully parsed, containing "<<num_records<<" records\n"; 299 319 300 320 }