summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2012-07-21 06:26:42 -0700
committerJohn Denker <jsd@av8n.com>2012-07-29 15:32:35 -0700
commitd747e6cea96000540619a1f1e2a33a4f01a25a67 (patch)
tree5a7efc598b11d640093b656af2ac254d3335931f /tools
parent60ebe6c00a2868e6bb69ef30cf04e5568276808b (diff)
don't return messy exit status codes in non-check mode
Diffstat (limited to 'tools')
-rw-r--r--tools/greylist.c19
1 files changed, 10 insertions, 9 deletions
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);
}