From d747e6cea96000540619a1f1e2a33a4f01a25a67 Mon Sep 17 00:00:00 2001 From: John Denker Date: Sat, 21 Jul 2012 06:26:42 -0700 Subject: don't return messy exit status codes in non-check mode --- tools/greylist.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'tools') diff --git a/tools/greylist.c b/tools/greylist.c index c5c891f..d76ba08 100644 --- a/tools/greylist.c +++ b/tools/greylist.c @@ -264,19 +264,20 @@ int main(int _argc, char** _argv){ } int sts = foo.doit(penalty); + if (sts == ex_syserr) return sts; + if (!check) return ex_good; -// perform some extra checks. +// check mode ... perform some extra checks. // Probably a better design would be to // a) make more thorough DNS checks, and // b) move all the DNS checking to a separate module - if (check){ - char* hostvar = getenv("TCPREMOTEHOST"); - if (!hostvar) { - cerr << foo.progid - << " from " << foo.ipbase - << " ... TCPREMOTEHOST not set???" << endl; - exeunt(ex_spam); - } + + char* hostvar = getenv("TCPREMOTEHOST"); + if (!hostvar) { + cerr << foo.progid + << " from " << foo.ipbase + << " ... TCPREMOTEHOST not set???" << endl; + exeunt(ex_spam); } exeunt(sts); } -- cgit v1.2.3