summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2002-07-22 14:01:44 +0000
committerkan <kan@FreeBSD.org>2002-07-22 14:01:44 +0000
commit751552f6c84a1ff8b78ca29ae1f0d5bf6172aa5d (patch)
tree20c320a146d56399245284fd91f2044541c5e661
parent7dd5d080be197420bb6df71ab46ca512e145a372 (diff)
downloadFreeBSD-src-751552f6c84a1ff8b78ca29ae1f0d5bf6172aa5d.zip
FreeBSD-src-751552f6c84a1ff8b78ca29ae1f0d5bf6172aa5d.tar.gz
Initialize sockbits variable with FD_ZERO, to avoid passing a fd_set
with random garbage in lower bits corresponding to stdin, stdout and stderr to select(2). This fixes the problem with nfsd sometimes getting stuck in a tight select(2) loop eating 100% CPU time. Reviewed by: iedowse Approved by: obrien
-rw-r--r--usr.sbin/nfsd/nfsd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.sbin/nfsd/nfsd.c b/usr.sbin/nfsd/nfsd.c
index 39fd0c5..77a8f18 100644
--- a/usr.sbin/nfsd/nfsd.c
+++ b/usr.sbin/nfsd/nfsd.c
@@ -355,6 +355,7 @@ main(argc, argv, envp)
(void)signal(SIGUSR1, cleanup);
FD_ZERO(&v4bits);
FD_ZERO(&v6bits);
+ FD_ZERO(&sockbits);
rpcbregcnt = 0;
/* Set up the socket for udp and rpcb register it. */
OpenPOWER on IntegriCloud