summaryrefslogtreecommitdiffstats
path: root/gnu/usr.sbin
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1995-07-15 23:27:49 +0000
committerwpaul <wpaul@FreeBSD.org>1995-07-15 23:27:49 +0000
commit7715d6b5da9aaadc191f2cffc225a5a82580c013 (patch)
tree366e567e3d48fec89ebe2ad8b9c02c63553e3c77 /gnu/usr.sbin
parent5322c9c163907cbc48e6900714978697db297fb7 (diff)
downloadFreeBSD-src-7715d6b5da9aaadc191f2cffc225a5a82580c013.zip
FreeBSD-src-7715d6b5da9aaadc191f2cffc225a5a82580c013.tar.gz
Some small signal handling tweaks: be sure to keep wait3()ing until all
children are reaped and make sure to block SIGCHLD delivery during handler execution when installing SIGCHLD handler with sigaction().
Diffstat (limited to 'gnu/usr.sbin')
-rw-r--r--gnu/usr.sbin/ypserv/server.c13
-rw-r--r--gnu/usr.sbin/ypserv/yp_svc.c1
2 files changed, 6 insertions, 8 deletions
diff --git a/gnu/usr.sbin/ypserv/server.c b/gnu/usr.sbin/ypserv/server.c
index 06103b5..cfcd7f1 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 <wpaul@ctr.columbia.edu>
**
-** $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 5e15089..2d920a6 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);
OpenPOWER on IntegriCloud