From 5761d098ffd2fc03907b0d38d7ac6dd65c429ee8 Mon Sep 17 00:00:00 2001 From: Christian Hofstaedtler Date: Wed, 28 Aug 2013 21:12:08 +0200 Subject: [PATCH] Fix zone2{sql,json} exit codes To be consistent with general practice, fix zone2{sql,json} to exit with: * 0 on success * 1 on error This also moves the catch block after the last line of main, so a "theoretically" possible exception in ::arg().mustDo would get caught. (Also, one level less of indent!) --- pdns/backends/bind/zone2json.cc | 30 ++++++++++++++---------------- pdns/backends/bind/zone2sql.cc | 29 +++++++++++++---------------- 2 files changed, 27 insertions(+), 32 deletions(-) diff --git a/pdns/backends/bind/zone2json.cc b/pdns/backends/bind/zone2json.cc index 3b8488b581..fda60801df 100644 --- a/pdns/backends/bind/zone2json.cc +++ b/pdns/backends/bind/zone2json.cc @@ -122,10 +122,10 @@ ArgvMap &arg() int main(int argc, char **argv) +try { vector lines; - try { reportAllTypes(); reportFancyTypes(); #if __GNUC__ >= 3 @@ -232,21 +232,19 @@ int main(int argc, char **argv) num_domainsdone=1; } cerr<= 3 @@ -379,26 +379,23 @@ int main(int argc, char **argv) } cerr<