summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1997-03-29 06:13:21 +0000
committerderaadt <deraadt@openbsd.org>1997-03-29 06:13:21 +0000
commit36249a8cf75c55bb8e344231e1859613450acc30 (patch)
tree561aaec640a500cac57deec90eaf81393b5a6cd5
parentif a bad socket is accept()ed, bail without trying another accept() (diff)
downloadwireguard-openbsd-36249a8cf75c55bb8e344231e1859613450acc30.tar.xz
wireguard-openbsd-36249a8cf75c55bb8e344231e1859613450acc30.zip
re-init width each time through the loop
-rw-r--r--usr.sbin/ypbind/ypbind.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c
index da66ff82178..ef8f6ef0487 100644
--- a/usr.sbin/ypbind/ypbind.c
+++ b/usr.sbin/ypbind/ypbind.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypbind.c,v 1.22 1997/03/26 05:23:57 deraadt Exp $ */
+/* $OpenBSD: ypbind.c,v 1.23 1997/03/29 06:13:21 deraadt Exp $ */
/*
* Copyright (c) 1996 Theo de Raadt <deraadt@theos.com>
@@ -34,7 +34,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: ypbind.c,v 1.22 1997/03/26 05:23:57 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: ypbind.c,v 1.23 1997/03/29 06:13:21 deraadt Exp $";
#endif
#include <sys/param.h>
@@ -514,17 +514,18 @@ main(argc, argv)
checkwork();
- width = svc_maxfd;
- if (rpcsock > width)
- width = rpcsock;
- if (pingsock > width)
- width = pingsock;
- width++;
-
while (1) {
fdsr = svc_fdset;
FD_SET(rpcsock, &fdsr);
FD_SET(pingsock, &fdsr);
+
+ width = svc_maxfd;
+ if (rpcsock > width)
+ width = rpcsock;
+ if (pingsock > width)
+ width = pingsock;
+ width++;
+
tv.tv_sec = 1;
tv.tv_usec = 0;