From 6c406aa0d9032512d45e1c7c84491e2afc784783 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 10 Jul 2012 13:32:35 -0500 Subject: [PATCH] add wait handler to forking code in ivrd --- libs/esl/ivrd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libs/esl/ivrd.c b/libs/esl/ivrd.c index 2e2e6b2fa4..6098abcaf9 100644 --- a/libs/esl/ivrd.c +++ b/libs/esl/ivrd.c @@ -35,6 +35,15 @@ #include #include #include +#include + +static void handle_SIGCHLD(int sig) +{ + int status = 0; + + wait(&status); + return; +} static void my_forking_callback(esl_socket_t server_sock, esl_socket_t client_sock, struct sockaddr_in *addr) { @@ -43,6 +52,8 @@ static void my_forking_callback(esl_socket_t server_sock, esl_socket_t client_so const char *path; char arg[64] = { 0 }; + signal(SIGCHLD, handle_SIGCHLD); + if (fork()) { close(client_sock); return;