add wait handler to forking code in ivrd

This commit is contained in:
Anthony Minessale 2012-07-10 13:32:35 -05:00
parent 6904ae6f3b
commit 6c406aa0d9

View File

@ -35,6 +35,15 @@
#include <stdlib.h>
#include <esl.h>
#include <errno.h>
#include <sys/wait.h>
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;