From 708917340b5a81f1617d9c99195222b269ac7d95 Mon Sep 17 00:00:00 2001 From: Hannu Ylitalo Date: Thu, 14 Jul 2016 19:07:06 +0300 Subject: [PATCH] pdnsutil: Remove checking of ctime and always diff the changes. Exit if no changes are found. --- pdns/pdnsutil.cc | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index a56feb906..5e44126f5 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -965,7 +965,6 @@ int editZone(DNSSECKeeper& dk, const DNSName &zone) { string d_name; } dm(tmpnam); - bool first=true; vector checkrr; int gotoline=0; string editor="editor"; @@ -999,8 +998,6 @@ int editZone(DNSSECKeeper& dk, const DNSName &zone) { tmpfd=-1; } editMore:; - struct stat statbefore, statafter; - stat(tmpnam,&statbefore); cmdline=editor+" "; if(gotoline > 0) cmdline+="+"+std::to_string(gotoline)+" "; @@ -1010,12 +1007,6 @@ int editZone(DNSSECKeeper& dk, const DNSName &zone) { unixDie("Editing file with: '"+cmdline+"', perhaps set EDITOR variable"); } cmdline.clear(); - stat(tmpnam,&statafter); - if(first && statbefore.st_ctime == statafter.st_ctime) { - cout<<"No change to file"<, vector > grouped; while(zpt.get(rr)) { @@ -1056,7 +1047,6 @@ int editZone(DNSSECKeeper& dk, const DNSName &zone) { goto reAsk; } - cout<<"Detected the following changes:\n"< diff; @@ -1076,16 +1066,17 @@ int editZone(DNSSECKeeper& dk, const DNSName &zone) { str<<'+'<< d.d_name <<" "<getZoneRepresentation(true)< 0) + cout<<"Detected the following changes:"<