Vanilla Development Maling List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS update: Vanilla/tools



Date:	Monday March 22, 1999 @ 18:56
Author:	ahn

Update of /home/netrek/cvsroot/Vanilla/tools
In directory cvs.castle.real-time.com:/var/tmp/cvs-serv2283

Modified Files:
	update.c 
Log Message:
no_zombies() to remove child zombie processes. -da


****************************************

Index: Vanilla/tools/update.c
diff -u Vanilla/tools/update.c:1.2 Vanilla/tools/update.c:1.3
--- Vanilla/tools/update.c:1.2	Tue Dec  1 13:34:55 1998
+++ Vanilla/tools/update.c	Mon Mar 22 18:56:11 1999
@@ -168,7 +168,21 @@
     return (sock);
 }
 
+/* prevent child zombie processes -da */
 
+void no_zombies(void) {
+
+  struct sigaction action;
+
+  action.sa_flags = SA_NOCLDWAIT;
+  action.sa_handler = SIG_DFL;
+  sigemptyset(&(action.sa_mask));
+  action.sa_sigaction = NULL;
+  sigaction(SIGCHLD, &action, NULL);
+
+}
+
+
 main(argc, argv)
 int argc;
 char **argv;
@@ -240,6 +254,11 @@
 #ifndef DEBUG
     if (!no_daemon) BecomeDaemon();
 #endif
+
+    /* SysV signals usually create zombie child processes unless SIGCHLD
+       is ignored.  -da */
+
+    no_zombies();
 
     for (;;) {