summaryrefslogtreecommitdiff
path: root/sbin/nfsd
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2013-03-11 17:40:12 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2013-03-11 17:40:12 +0000
commit039b61c058ed96cb3a888f9dee21bca7997f0a39 (patch)
treee836c8501a7ce9ead08db116a7d3413b4c79e0ff /sbin/nfsd
parent11f71752a566cd212ee320890884ad5c2b6dcc64 (diff)
handle ECONNABORTED errors from accept(). In many code blocks they can be
ignored silently and without aborting, much like EINTR and EWOULDBLOCK are. ok's from various maintainers of these directories...
Diffstat (limited to 'sbin/nfsd')
-rw-r--r--sbin/nfsd/nfsd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/nfsd/nfsd.c b/sbin/nfsd/nfsd.c
index 6c26ed8fc8a..c6e9c133f7f 100644
--- a/sbin/nfsd/nfsd.c
+++ b/sbin/nfsd/nfsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfsd.c,v 1.31 2010/04/17 16:27:49 krw Exp $ */
+/* $OpenBSD: nfsd.c,v 1.32 2013/03/11 17:40:10 deraadt Exp $ */
/* $NetBSD: nfsd.c,v 1.19 1996/02/18 23:18:56 mycroft Exp $ */
/*
@@ -304,6 +304,9 @@ main(int argc, char *argv[])
len = sizeof(inetpeer);
if ((msgsock = accept(tcpsock,
(struct sockaddr *)&inetpeer, &len)) < 0) {
+ if (errno == EWOULDBLOCK || errno == EINTR ||
+ errno == ECONNABORTED)
+ continue;
syslog(LOG_ERR, "accept failed: %m");
return (1);
}