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.
This commit is contained in:
parent
c5bb6008ce
commit
ae5fc38127
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=21104
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user