diff options
author | peter <peter@FreeBSD.org> | 1996-12-30 18:51:59 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1996-12-30 18:51:59 +0000 |
commit | 35394c309a8051795d882df45f88107d2c96979c (patch) | |
tree | 3cfdbe28ad2bae62be342151f11af31bae805ca0 /usr.sbin | |
parent | 30336e7710816228ba669ad55fb8233304c882c5 (diff) | |
download | FreeBSD-src-35394c309a8051795d882df45f88107d2c96979c.zip FreeBSD-src-35394c309a8051795d882df45f88107d2c96979c.tar.gz |
Make the select() call work like the others in the system.. ie: don't
assume that the timeval will be preserved. As the man page says:
".. it is unwise to assume that the timeout value will be unmodified
by the select() call." This happens on Linux and on my system at least.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ypserv/yp_main.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/ypserv/yp_main.c b/usr.sbin/ypserv/yp_main.c index e76b575..ae7ce9a 100644 --- a/usr.sbin/ypserv/yp_main.c +++ b/usr.sbin/ypserv/yp_main.c @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: yp_main.c,v 1.10 1996/12/25 18:10:34 wpaul Exp $ + * $Id: yp_main.c,v 1.11 1996/12/30 15:32:43 peter Exp $ */ /* @@ -66,7 +66,7 @@ #define _RPCSVC_CLOSEDOWN 120 #ifndef lint -static const char rcsid[] = "$Id: yp_main.c,v 1.10 1996/12/25 18:10:34 wpaul Exp $"; +static const char rcsid[] = "$Id: yp_main.c,v 1.11 1996/12/30 15:32:43 peter Exp $"; #endif /* not lint */ int _rpcpmstart; /* Started by a port monitor ? */ static int _rpcfdtype; @@ -110,7 +110,7 @@ yp_svc_run() extern int forked; int pid; int fd_setsize = _rpc_dtablesize(); - struct timeval timeout = { RESOLVER_TIMEOUT, 0 }; + struct timeval timeout; /* Establish the identity of the parent ypserv process. */ pid = getpid(); @@ -124,6 +124,8 @@ yp_svc_run() FD_SET(resfd, &readfds); + timeout.tv_sec = RESOLVER_TIMEOUT; + timeout.tv_usec = 0; switch (select(fd_setsize, &readfds, NULL, NULL, &timeout)) { case -1: |