summaryrefslogtreecommitdiffstats
path: root/usr.sbin/inetd
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-05-11 12:11:59 +0000
committerbde <bde@FreeBSD.org>1998-05-11 12:11:59 +0000
commitbfcb7bdce1a0ada2f30a8235805e653c64badde7 (patch)
treea6515da9f76e79f6b85ffcc5f6e4315f129f80ab /usr.sbin/inetd
parent979207101dbdada6233fd3bb3204a539c00cf9f4 (diff)
downloadFreeBSD-src-bfcb7bdce1a0ada2f30a8235805e653c64badde7.zip
FreeBSD-src-bfcb7bdce1a0ada2f30a8235805e653c64badde7.tar.gz
Fixed gross errors in previous commit. `sapipe' was used uninitialized
to attempt to unblock SIGCHLD, but we actually want to unignore SIGPIPE. Obtained from: OpenBSD Finished conversion from sigvec to sigaction (don't assume that sa_mask is a scalar...). Didn't convert from sigblock to sigprocmask. Didn't fix missing error checking for sigaction...
Diffstat (limited to 'usr.sbin/inetd')
-rw-r--r--usr.sbin/inetd/inetd.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index 086508d..cd41030 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)from: inetd.c 8.4 (Berkeley) 4/13/94";
#endif
static const char rcsid[] =
- "$Id: inetd.c,v 1.31 1998/05/07 18:32:00 guido Exp $";
+ "$Id: inetd.c,v 1.32 1998/05/08 19:15:44 guido Exp $";
#endif /* not lint */
/*
@@ -400,8 +400,11 @@ main(argc, argv, envp)
syslog(LOG_WARNING, "%s: %m", pid_file);
}
}
- memset(&sa, 0, sizeof(sa));
- sa.sa_mask = SIGBLOCK;
+ sa.sa_flags = 0;
+ sigemptyset(&sa.sa_mask);
+ sigaddset(&sa.sa_mask, SIGALRM);
+ sigaddset(&sa.sa_mask, SIGCHLD);
+ sigaddset(&sa.sa_mask, SIGHUP);
sa.sa_handler = retry;
sigaction(SIGALRM, &sa, (struct sigaction *)0);
config(SIGHUP);
@@ -410,7 +413,7 @@ main(argc, argv, envp)
sa.sa_handler = reapchild;
sigaction(SIGCHLD, &sa, (struct sigaction *)0);
sa.sa_handler = SIG_IGN;
- sigaction(SIGPIPE, &sa, (struct sigaction *)0);
+ sigaction(SIGPIPE, &sa, &sapipe);
{
/* space for daemons to overwrite environment for ps */
@@ -622,8 +625,8 @@ main(argc, argv, envp)
}
}
#endif
- sigaction(SIGCHLD, &sapipe,
- (struct sigaction *)0);
+ sigaction(SIGPIPE, &sapipe,
+ (struct sigaction *)0);
execv(sep->se_server, sep->se_argv);
if (sep->se_socktype != SOCK_STREAM)
recv(0, buf, sizeof (buf), 0);
@@ -1745,7 +1748,8 @@ getline(fd, buf, len)
int count = 0, n;
struct sigaction sa;
- memset(&sa, 0, sizeof(sa));
+ sa.sa_flags = 0;
+ sigemptyset(&sa.sa_mask);
sa.sa_handler = SIG_DFL;
sigaction(SIGALRM, &sa, (struct sigaction *)0);
do {
OpenPOWER on IntegriCloud