summaryrefslogtreecommitdiff
path: root/src/run.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2009-05-23 12:09:06 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2009-05-23 12:09:06 +0200
commit0374398fd14bf587d80d9d31e361e266e69387c8 (patch)
tree2984629205760d10660fa43c237073e555ce03c8 /src/run.c
parent91bf01ee31b754bb17f612ee13685ef0ffe9baa8 (diff)
downloadconntrack-tools-0374398fd14bf587d80d9d31e361e266e69387c8.tar.gz
conntrack-tools-0374398fd14bf587d80d9d31e361e266e69387c8.zip
conntrackd: add child process infrastructure
This patch adds a simple infrastructure that allows to account the child processes that have been forked. This also includes a callback handler that can be registered that is called once the child process finishes. We can extended this later to include an alarm to limit the maximum lifetime of a forked child process. This is good to ensure that child processes behave timely. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/run.c')
-rw-r--r--src/run.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/run.c b/src/run.c
index 6465699..09e2ae9 100644
--- a/src/run.c
+++ b/src/run.c
@@ -25,6 +25,7 @@
#include "alarm.h"
#include "fds.h"
#include "traffic_stats.h"
+#include "process.h"
#include <errno.h>
#include <signal.h>
@@ -77,6 +78,9 @@ static void child(int foo)
STATE(stats).wait_failed++;
break;
}
+ /* delete process from list and run the callback */
+ fork_process_delete(ret);
+
if (!WIFSIGNALED(status))
continue;