summaryrefslogtreecommitdiffstats
path: root/usr.sbin/inetd/inetd.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/inetd/inetd.c')
-rw-r--r--usr.sbin/inetd/inetd.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index 07ae88c..341c89b 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.61 1999/07/15 17:01:43 green Exp $";
+ "$Id: inetd.c,v 1.62 1999/07/21 12:19:24 sheldonh Exp $";
#endif /* not lint */
/*
@@ -351,7 +351,7 @@ main(argc, argv, envp)
struct servtab *sep;
struct passwd *pwd;
struct group *grp;
- struct sigaction sa, sapipe;
+ struct sigaction sa, saalrm, sachld, sahup, sapipe;
int tmpint, ch, dofork;
pid_t pid;
char buf[50];
@@ -457,12 +457,12 @@ main(argc, argv, envp)
sigaddset(&sa.sa_mask, SIGCHLD);
sigaddset(&sa.sa_mask, SIGHUP);
sa.sa_handler = flag_retry;
- sigaction(SIGALRM, &sa, (struct sigaction *)0);
+ sigaction(SIGALRM, &sa, &saalrm);
config();
sa.sa_handler = flag_config;
- sigaction(SIGHUP, &sa, (struct sigaction *)0);
+ sigaction(SIGHUP, &sa, &sahup);
sa.sa_handler = flag_reapchild;
- sigaction(SIGCHLD, &sa, (struct sigaction *)0);
+ sigaction(SIGCHLD, &sa, &sachld);
sa.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &sa, &sapipe);
@@ -624,6 +624,10 @@ main(argc, argv, envp)
for (tmpint = maxsock; tmpint > 2; tmpint--)
if (tmpint != ctrl)
(void) close(tmpint);
+ sigaction(SIGALRM, &saalrm, (struct sigaction *)0);
+ sigaction(SIGCHLD, &sachld, (struct sigaction *)0);
+ sigaction(SIGHUP, &sahup, (struct sigaction *)0);
+ /* SIGPIPE reset before exec */
}
/*
* Call tcpmux to find the real service to exec.
OpenPOWER on IntegriCloud