From 0374398fd14bf587d80d9d31e361e266e69387c8 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sat, 23 May 2009 12:09:06 +0200 Subject: 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 --- src/run.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/run.c') 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 #include @@ -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; -- cgit v1.2.3