[Openvas-commits] r6669 - in trunk/openvas-administrator: . src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Feb 5 17:36:06 CET 2010


Author: mattm
Date: 2010-02-05 17:36:06 +0100 (Fri, 05 Feb 2010)
New Revision: 6669

Modified:
   trunk/openvas-administrator/ChangeLog
   trunk/openvas-administrator/src/admin.c
Log:
	* src/admin.c (openvas_sync_feed): Prevent descendants from becoming
	zombies.

Modified: trunk/openvas-administrator/ChangeLog
===================================================================
--- trunk/openvas-administrator/ChangeLog	2010-02-05 12:01:34 UTC (rev 6668)
+++ trunk/openvas-administrator/ChangeLog	2010-02-05 16:36:06 UTC (rev 6669)
@@ -1,3 +1,8 @@
+2010-02-05  Matthew Mundell <matthew.mundell at intevation.de>
+
+	* src/admin.c (openvas_sync_feed): Prevent descendants from becoming
+	zombies.
+
 2010-02-05  Michael Wiegand <michael.wiegand at intevation.de>
 
 	Post release version bump.

Modified: trunk/openvas-administrator/src/admin.c
===================================================================
--- trunk/openvas-administrator/src/admin.c	2010-02-05 12:01:34 UTC (rev 6668)
+++ trunk/openvas-administrator/src/admin.c	2010-02-05 16:36:06 UTC (rev 6669)
@@ -42,6 +42,7 @@
 #include <gcrypt.h>
 #include <glib.h>
 #include <glib/gstdio.h>
+#include <signal.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
@@ -1267,6 +1268,15 @@
       return -1;
     }
 
+  /* Prevent descendants from becoming zombies. */
+
+  /* RATS: ignore, this is SIG_IGN damnit. */
+  if (signal (SIGCHLD, SIG_IGN) == SIG_ERR)
+    {
+      g_warning ("Failed to set SIG_IGN");
+      return -1;
+    }
+
   /* Fork a child to run the sync while the parent responds to
    * the client. */
 
@@ -1284,7 +1294,16 @@
         return -1;
         break;
       default:
-        /* Parent.  Return, in order to respond to client. */
+        /* Parent.  Restore SIGCHLD handler then return in order to
+         * respond to client. */
+
+        /* RATS: ignore, this is SIG_DFL damnit. */
+        if (signal (SIGCHLD, SIG_DFL) == SIG_ERR)
+          {
+            g_warning ("Failed to set SIG_DFL");
+            return -1;
+          }
+
         return 0;
         break;
     }



More information about the Openvas-commits mailing list