diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2003-09-26 04:42:12 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2003-09-26 04:42:12 +0000 |
commit | 7ef81666f43bda28fddd7721b366d0c3a72eddd0 (patch) | |
tree | 99e0b2fee915252e808e6ef0cfa36e80d367d6c1 /libexec/spamd | |
parent | a5134eefdcfd418bcb3e4c38acb612f62e0c2fc1 (diff) |
make accept failures not globally fatal.
ok deraadt@
Diffstat (limited to 'libexec/spamd')
-rw-r--r-- | libexec/spamd/spamd.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/libexec/spamd/spamd.c b/libexec/spamd/spamd.c index b8f0b56c925..3435a12f6d4 100644 --- a/libexec/spamd/spamd.c +++ b/libexec/spamd/spamd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spamd.c,v 1.46 2003/09/26 01:58:55 deraadt Exp $ */ +/* $OpenBSD: spamd.c,v 1.47 2003/09/26 04:42:11 beck Exp $ */ /* * Copyright (c) 2002 Theo de Raadt. All rights reserved. @@ -1013,11 +1013,9 @@ main(int argc, char *argv[]) if (FD_ISSET(s, fdsr)) { sinlen = sizeof(sin); s2 = accept(s, (struct sockaddr *)&sin, &sinlen); - if (s2 == -1) { - if (errno == EINTR) - continue; - err(1, "accept"); - } + if (s2 == -1) + /* accept failed, they may try again */ + continue; for (i = 0; i < maxcon; i++) if (con[i].fd == -1) break; @@ -1033,11 +1031,10 @@ main(int argc, char *argv[]) sinlen = sizeof(lin); conffd = accept(conflisten, (struct sockaddr *)&lin, &sinlen); - if (conffd == -1) { - if (errno == EINTR) - continue; - err(1, "accept"); - } else if (ntohs(lin.sin_port) >= IPPORT_RESERVED) { + if (conffd == -1) + /* accept failed, they may try again */ + continue; + else if (ntohs(lin.sin_port) >= IPPORT_RESERVED) { close(conffd); conffd = -1; } |