more lost changes BSD signals -> SysV signals. Noticed by Bernhard

This commit is contained in:
"Vladimir N. Oleynik" 2005-10-05 14:14:55 +00:00
parent f382c0236e
commit c06e80e1e7

View File

@ -177,8 +177,6 @@
#define CNT_INTVL 60 /* servers in CNT_INTVL sec. */ #define CNT_INTVL 60 /* servers in CNT_INTVL sec. */
#define RETRYTIME (60*10) /* retry after bind or server fail */ #define RETRYTIME (60*10) /* retry after bind or server fail */
#define SIGBLOCK (sigmask(SIGCHLD)|sigmask(SIGHUP)|sigmask(SIGALRM))
#ifndef RLIMIT_NOFILE #ifndef RLIMIT_NOFILE
#define RLIMIT_NOFILE RLIMIT_OFILE #define RLIMIT_NOFILE RLIMIT_OFILE
#endif #endif
@ -1276,6 +1274,7 @@ inetd_main (int argc, char *argv[])
pid_t pid; pid_t pid;
char buf[50]; char buf[50];
char *stoomany; char *stoomany;
sigset_t omask;
#ifdef INETD_SETPROCTITLE #ifdef INETD_SETPROCTITLE
extern char **environ; extern char **environ;
@ -1383,10 +1382,10 @@ inetd_main (int argc, char *argv[])
fd_set readable; fd_set readable;
if (nsock == 0) { if (nsock == 0) {
(void) sigblock (SIGBLOCK); Block_Using_Signals(omask);
while (nsock == 0) while (nsock == 0)
sigpause (0L); sigpause (0L);
(void) sigsetmask (0L); sigprocmask(SIG_UNBLOCK, &omask, NULL);
} }
readable = allsock; readable = allsock;
@ -1425,7 +1424,7 @@ inetd_main (int argc, char *argv[])
} }
} else } else
ctrl = sep->se_fd; ctrl = sep->se_fd;
(void) sigblock (SIGBLOCK); Block_Using_Signals(omask);
pid = 0; pid = 0;
#ifdef INETD_FEATURE_ENABLED #ifdef INETD_FEATURE_ENABLED
if (sep->se_bi == 0 || sep->se_bi->bi_fork) if (sep->se_bi == 0 || sep->se_bi->bi_fork)
@ -1463,7 +1462,7 @@ inetd_main (int argc, char *argv[])
sep->se_fd = -1; sep->se_fd = -1;
sep->se_count = 0; sep->se_count = 0;
nsock--; nsock--;
sigsetmask (0L); sigprocmask(SIG_UNBLOCK, &omask, NULL);
if (!timingout) { if (!timingout) {
timingout = 1; timingout = 1;
alarm (RETRYTIME); alarm (RETRYTIME);
@ -1477,7 +1476,7 @@ inetd_main (int argc, char *argv[])
syslog (LOG_ERR, "fork: %m"); syslog (LOG_ERR, "fork: %m");
if (!sep->se_wait && sep->se_socktype == SOCK_STREAM) if (!sep->se_wait && sep->se_socktype == SOCK_STREAM)
close (ctrl); close (ctrl);
sigsetmask (0L); sigprocmask(SIG_UNBLOCK, &omask, NULL);
sleep (1); sleep (1);
continue; continue;
} }
@ -1486,7 +1485,7 @@ inetd_main (int argc, char *argv[])
FD_CLR (sep->se_fd, &allsock); FD_CLR (sep->se_fd, &allsock);
nsock--; nsock--;
} }
sigsetmask (0L); sigprocmask(SIG_UNBLOCK, &omask, NULL);
if (pid == 0) { if (pid == 0) {
#ifdef INETD_FEATURE_ENABLED #ifdef INETD_FEATURE_ENABLED
if (sep->se_bi) { if (sep->se_bi) {