mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-09 09:17:34 +00:00
esl: Don't abort the esl_listen() loop(s) if accept() returns with errno == EINTR
ivrd doesn't use sigaction + SA_RESTART for SIGCHILD. An exiting child process will interrupt accept() in the parent to handle the signal, which makes accept() return -1 (errno = EINTR) after the sighandler function returns. Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
This commit is contained in:
parent
ca1d407921
commit
cb9090dc93
@ -696,7 +696,7 @@ ESL_DECLARE(esl_status_t) esl_listen(const char *host, esl_port_t port, esl_list
|
|||||||
|
|
||||||
clntLen = sizeof(echoClntAddr);
|
clntLen = sizeof(echoClntAddr);
|
||||||
|
|
||||||
if ((client_sock = accept(server_sock, (struct sockaddr *) &echoClntAddr, &clntLen)) == ESL_SOCK_INVALID) {
|
if ((client_sock = accept(server_sock, (struct sockaddr *) &echoClntAddr, &clntLen)) == ESL_SOCK_INVALID && errno != EINTR) {
|
||||||
status = ESL_FAIL;
|
status = ESL_FAIL;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
@ -754,7 +754,7 @@ ESL_DECLARE(esl_status_t) esl_listen_threaded(const char *host, esl_port_t port,
|
|||||||
|
|
||||||
clntLen = sizeof(echoClntAddr);
|
clntLen = sizeof(echoClntAddr);
|
||||||
|
|
||||||
if ((client_sock = accept(server_sock, (struct sockaddr *) &echoClntAddr, &clntLen)) == ESL_SOCK_INVALID) {
|
if ((client_sock = accept(server_sock, (struct sockaddr *) &echoClntAddr, &clntLen)) == ESL_SOCK_INVALID && errno != EINTR) {
|
||||||
status = ESL_FAIL;
|
status = ESL_FAIL;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user