diff --git a/gnu/usr.sbin/ypserv/server.c b/gnu/usr.sbin/ypserv/server.c index 06103b54e75..cfcd7f198a8 100644 --- a/gnu/usr.sbin/ypserv/server.c +++ b/gnu/usr.sbin/ypserv/server.c @@ -24,7 +24,7 @@ ** Ported to FreeBSD and hacked all to pieces ** by Bill Paul ** -** $Id: server.c,v 1.9 1995/07/14 01:56:49 wpaul Exp $ +** $Id: server.c,v 1.7 1995/07/02 18:48:21 wpaul Exp $ ** */ @@ -808,8 +808,8 @@ int sig; { int st; - children--; - wait3(&st, WNOHANG, NULL); + while (wait3(&st, WNOHANG, NULL) > 0) + children--; } /* @@ -861,7 +861,7 @@ ypresp_xfr *ypproc_xfr_2_svc(ypreq_xfr *xfr, switch(fork()) { case 0: - { + { char g[11], t[11], p[11]; sprintf (ypxfr_command, "%s/ypxfr", INSTDIR); @@ -873,13 +873,10 @@ ypresp_xfr *ypproc_xfr_2_svc(ypreq_xfr *xfr, inet_ntoa(rqhost->sin_addr), p, xfr->map_parms.map, NULL); Perror("ypxfr execl(): %s",strerror(errno)); exit(0); - } + } case -1: - { Perror("fork(): %s",strerror(errno)); result.xfrstat = YPXFR_XFRERR; - break; - } default: { result.xfrstat = YPXFR_SUCC; diff --git a/gnu/usr.sbin/ypserv/yp_svc.c b/gnu/usr.sbin/ypserv/yp_svc.c index 5e150890e11..2d920a6eef6 100644 --- a/gnu/usr.sbin/ypserv/yp_svc.c +++ b/gnu/usr.sbin/ypserv/yp_svc.c @@ -329,6 +329,7 @@ int main(int argc, char **argv) sigaction(SIGCHLD, NULL, &sa); sa.sa_flags |= SA_RESTART; sa.sa_handler = reapchild; + sa.sa_mask = sigmask(SIGCHLD); sigaction(SIGCHLD, &sa, NULL); (void) pmap_unset(YPPROG, YPVERS); diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c index 49f8587ead0..0d68818d7d7 100644 --- a/usr.sbin/ypbind/ypbind.c +++ b/usr.sbin/ypbind/ypbind.c @@ -28,7 +28,7 @@ */ #ifndef LINT -static char rcsid[] = "$Id: ypbind.c,v 1.14 1995/05/29 16:39:52 wpaul Exp $"; +static char rcsid[] = "$Id: ypbind.c,v 1.15 1995/05/30 03:55:13 rgrimes Exp $"; #endif #include @@ -316,7 +316,8 @@ int sig; { int st; - wait3(&st, WNOHANG, NULL); + while(wait3(&st, WNOHANG, NULL) > 0) + children--; } void terminate(sig) @@ -462,7 +463,6 @@ char **argv; for(ypdb=ypbindlist; ypdb; ypdb=ypdb->dom_pnext) { if (READFD > 0 && FD_ISSET(READFD, &fdsr)) { handle_children(ypdb); - children--; if (children == (MAX_CHILDREN - 1)) checkwork(); }