Style cleanups.

Requested by:	bde
This commit is contained in:
Dag-Erling Smørgrav 1999-01-02 16:04:19 +00:00
parent 9d9fdb45c5
commit 87cef388ff

View File

@ -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.41 1998/11/04 19:39:46 phk Exp $";
"$Id: inetd.c,v 1.44 1998/12/28 15:09:43 des Exp $";
#endif /* not lint */
/*
@ -436,8 +436,7 @@ main(argc, argv, envp)
(void)setenv("inetd_dummy", dummy, 1);
}
if (pipe(signalpipe) != 0)
{
if (pipe(signalpipe) != 0) {
syslog(LOG_ERR, "pipe: %%m");
exit(EX_OSERR);
}
@ -464,39 +463,32 @@ main(argc, argv, envp)
continue;
}
/* handle any queued signal flags */
if (FD_ISSET(signalpipe[0], &readable))
{
if (FD_ISSET(signalpipe[0], &readable)) {
int n;
if (ioctl(signalpipe[0], FIONREAD, &n) == 0)
{
while (--n >= 0)
{
if (ioctl(signalpipe[0], FIONREAD, &n) != 0) {
syslog(LOG_ERR, "ioctl: %m");
exit(EX_OSERR);
}
while (--n >= 0) {
char c;
if (read(signalpipe[0], &c, 1) == 1)
{
if (debug) warnx("Handling signal flag %c", c);
switch(c)
{
case 'A': /* sigalrm */
retry(); break;
case 'C': /* sigchld */
reapchild(); break;
case 'H': /* sighup */
config(); break;
}
}
else
{
if (read(signalpipe[0], &c, 1) != 1) {
syslog(LOG_ERR, "read: %m");
exit(EX_OSERR);
}
if (debug)
warnx("Handling signal flag %c", c);
switch(c) {
case 'A': /* sigalrm */
retry();
break;
case 'C': /* sigchld */
reapchild();
break;
case 'H': /* sighup */
config();
break;
}
}
else
{
syslog(LOG_ERR, "ioctl: %m");
exit(EX_OSERR);
}
}
for (sep = servtab; n && sep; sep = sep->se_next)
if (sep->se_fd != -1 && FD_ISSET(sep->se_fd, &readable)) {
@ -705,8 +697,7 @@ main(argc, argv, envp)
void flag_signal(c)
char c;
{
if (write(signalpipe[1], &c, 1) != 1)
{
if (write(signalpipe[1], &c, 1) != 1) {
syslog(LOG_ERR, "write: %m");
exit(EX_OSERR);
}