提交 6c406aa0 authored 作者: Anthony Minessale's avatar Anthony Minessale

add wait handler to forking code in ivrd

上级 6904ae6f
......@@ -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;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论