svn commit: trunk/busybox/networking

vodz at busybox.net vodz at busybox.net
Wed Oct 5 14:15:14 UTC 2005


Author: vodz
Date: 2005-10-05 07:14:55 -0700 (Wed, 05 Oct 2005)
New Revision: 11773

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

Modified:
   trunk/busybox/networking/inetd.c


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




More information about the busybox-cvs mailing list