mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 20:50:41 +00:00
add wait handler to forking code in ivrd
This commit is contained in:
parent
6904ae6f3b
commit
6c406aa0d9
@ -35,6 +35,15 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <esl.h>
|
#include <esl.h>
|
||||||
#include <errno.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)
|
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;
|
const char *path;
|
||||||
char arg[64] = { 0 };
|
char arg[64] = { 0 };
|
||||||
|
|
||||||
|
signal(SIGCHLD, handle_SIGCHLD);
|
||||||
|
|
||||||
if (fork()) {
|
if (fork()) {
|
||||||
close(client_sock);
|
close(client_sock);
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user