summaryrefslogtreecommitdiff
path: root/usr.sbin/inetd/inetd.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-01-06 19:45:55 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-01-06 19:45:55 +0000
commitee3ac7a900be58f3051d8c82025a263f09a7d911 (patch)
treeb76097bad7c1c54ab03afc1394d876bacb4e07b7 /usr.sbin/inetd/inetd.c
parent5d30d0391878cb9af5cd15b766f0096e06b9fd48 (diff)
Fix signal handling when there is an error in inetd.conf. Found by
mpech@. OK mpech@ and deraadt@
Diffstat (limited to 'usr.sbin/inetd/inetd.c')
-rw-r--r--usr.sbin/inetd/inetd.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index 1b50f1a53b2..73e8a2d1e9e 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inetd.c,v 1.114 2003/12/23 15:24:28 mpech Exp $ */
+/* $OpenBSD: inetd.c,v 1.115 2004/01/06 19:45:54 millert Exp $ */
/*
* Copyright (c) 1983,1991 The Regents of the University of California.
@@ -37,7 +37,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)inetd.c 5.30 (Berkeley) 6/3/91";*/
-static char rcsid[] = "$OpenBSD: inetd.c,v 1.114 2003/12/23 15:24:28 mpech Exp $";
+static char rcsid[] = "$OpenBSD: inetd.c,v 1.115 2004/01/06 19:45:54 millert Exp $";
#endif /* not lint */
/*
@@ -429,17 +429,18 @@ main(int argc, char *argv[])
for (;;) {
int n, ctrl = -1;
+ restart:
if (nsock == 0) {
(void) sigprocmask(SIG_BLOCK, &blockmask, NULL);
while (nsock == 0) {
- if (wantretry || wantconfig || wantreap)
+ if (wantretry || wantconfig || wantreap || wantdie)
break;
sigsuspend(&emptymask);
}
(void) sigprocmask(SIG_SETMASK, &emptymask, NULL);
}
- if (wantretry || wantconfig || wantreap || wantdie) {
+ while (wantretry || wantconfig || wantreap || wantdie) {
if (wantretry) {
doretry();
wantretry = 0;
@@ -454,7 +455,7 @@ main(int argc, char *argv[])
}
if (wantdie)
dodie();
- continue;
+ goto restart;
}
if (readablen != allsockn) {