Clean up any zombie processes whenever a new request is forked.
authorMargaret Wasserman <mrw@painless-security.com>
Mon, 15 Sep 2014 15:31:58 +0000 (11:31 -0400)
committerMargaret Wasserman <mrw@painless-security.com>
Mon, 15 Sep 2014 15:31:58 +0000 (11:31 -0400)
tid/tids.c

index 26e14af..431fa4a 100644 (file)
@@ -387,9 +387,12 @@ int tids_start (TIDS_INSTANCE *tids,
     } else {
       close(conn);
     }
+
+    /* clean up any processes that have completed */
+    while (waitpid(-1, 0, WNOHANG) >= 0);
   }
 
-  return 1;    /* should never get here */
+  return 1;    /* should never get here, loops "forever" */
 }
 
 void tids_destroy (TIDS_INSTANCE *tids)