diff options
Diffstat (limited to 'usr.sbin/ypserv/yp_main.c')
-rw-r--r-- | usr.sbin/ypserv/yp_main.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/usr.sbin/ypserv/yp_main.c b/usr.sbin/ypserv/yp_main.c index f20ccb3..dbd38fe 100644 --- a/usr.sbin/ypserv/yp_main.c +++ b/usr.sbin/ypserv/yp_main.c @@ -32,7 +32,7 @@ #ifndef lint static const char rcsid[] = - "$Id: yp_main.c,v 1.18 1998/06/04 15:11:14 wpaul Exp $"; + "$Id: yp_main.c,v 1.19 1999/02/10 16:16:14 wpaul Exp $"; #endif /* not lint */ /* @@ -99,6 +99,8 @@ void _msgout(char* msg) syslog(LOG_ERR, msg); } +pid_t yp_pid; + static void yp_svc_run() { @@ -108,12 +110,11 @@ yp_svc_run() int readfds; #endif /* def FD_SETSIZE */ extern int forked; - int pid; int fd_setsize = _rpc_dtablesize(); struct timeval timeout; /* Establish the identity of the parent ypserv process. */ - pid = getpid(); + yp_pid = getpid(); for (;;) { #ifdef FD_SETSIZE @@ -135,16 +136,19 @@ yp_svc_run() warn("svc_run: - select failed"); return; case 0: - yp_prune_dnsq(); + if (getpid() == yp_pid) + yp_prune_dnsq(); break; default: - if (FD_ISSET(resfd, &readfds)) { - yp_run_dnsq(); - FD_CLR(resfd, &readfds); + if (getpid() == yp_pid) { + if (FD_ISSET(resfd, &readfds)) { + yp_run_dnsq(); + FD_CLR(resfd, &readfds); + } + svc_getreqset(&readfds); } - svc_getreqset(&readfds); } - if (forked && pid != getpid()) + if (yp_pid != getpid()) _exit(0); } } |