Add waitpid() when recorders are destroyed for avoiding zombie processes.
When udp_port is inappropriate, a parent process will destroy all child recorder
processes. Currently, the process does not wait for the termination of the
children, so those recorders can become zombie processes if the parent process
cannot die at once due to any reasons.

Signed-off-by: Yoshihiro YUNOMAE <yoshihiro.yunomae...@hitachi.com>
---
 trace-listen.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/trace-listen.c b/trace-listen.c
index dec1c00..6c1bcac 100644
--- a/trace-listen.c
+++ b/trace-listen.c
@@ -446,6 +446,7 @@ static void process_client(const char *node, const char 
*port, int fd)
        for (cpu = 0; cpu < cpus; cpu++) {
                if (pid_array[cpu] > 0) {
                        kill(pid_array[cpu], SIGKILL);
+                       waitpid(pid_array[cpu], NULL, 0);
                        delete_temp_file(node, port, cpu);
                        pid_array[cpu] = 0;
                }

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to