diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2007-08-16 04:42:17 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2007-08-16 04:42:17 +0000 |
commit | d1d49fbe20833127e22195b97129b18aff260ec8 (patch) | |
tree | b41de0e35115020b27fc3df27b14efa977d6e366 /libexec/spamd | |
parent | 47ecf2213302d9fa2d848b66de4feaff707dc042 (diff) |
- Don't fill spamd debug with bogus config errors if there are no
traps.
- Change count to size_t to avoid a size_t -> int conversion.
- Since configure_spamd always returns 0, change to void.
- Since configure_spamd now returns void, remove unreachable logging
statement.
OK ckuethe and deraadt, initial diff from fgsch@ and OKed by beck.
Diffstat (limited to 'libexec/spamd')
-rw-r--r-- | libexec/spamd/grey.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libexec/spamd/grey.c b/libexec/spamd/grey.c index 29a476f8349..e30333a288a 100644 --- a/libexec/spamd/grey.c +++ b/libexec/spamd/grey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grey.c,v 1.39 2007/03/18 18:38:57 beck Exp $ */ +/* $OpenBSD: grey.c,v 1.40 2007/08/16 04:42:16 ray Exp $ */ /* * Copyright (c) 2004-2006 Bob Beck. All rights reserved. @@ -121,18 +121,19 @@ sig_term_chld(int sig) * to collapse cidr ranges since these are only ever single * host hits. */ -int -configure_spamd(char **addrs, int count, FILE *sdc) +void +configure_spamd(char **addrs, size_t count, FILE *sdc) { - int i; + size_t i; + if (count == 0) + return; fprintf(sdc, "%s;%s;", traplist_name, traplist_msg); for (i = 0; i < count; i++) fprintf(sdc, "%s/32;", addrs[i]); fprintf(sdc, "\n"); if (fflush(sdc) == EOF) syslog_r(LOG_DEBUG, &sdata, "configure_spamd: fflush failed (%m)"); - return(0); } @@ -628,8 +629,7 @@ greyscan(char *dbname) db->close(db); db = NULL; configure_pf(whitelist, whitecount); - if (configure_spamd(traplist, trapcount, trapcfg) == -1) - syslog_r(LOG_DEBUG, &sdata, "configure_spamd failed"); + configure_spamd(traplist, trapcount, trapcfg); freeaddrlists(); free(a); |