mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-03 14:16:27 +00:00
freetdm: retry polling in DAHDI devices when fails due to interrupted system call
This commit is contained in:
parent
21e1f69b98
commit
5486b8c74d
@ -889,13 +889,18 @@ static FIO_WAIT_FUNCTION(zt_wait)
|
|||||||
inflags |= POLLPRI;
|
inflags |= POLLPRI;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pollagain:
|
||||||
memset(&pfds[0], 0, sizeof(pfds[0]));
|
memset(&pfds[0], 0, sizeof(pfds[0]));
|
||||||
pfds[0].fd = ftdmchan->sockfd;
|
pfds[0].fd = ftdmchan->sockfd;
|
||||||
pfds[0].events = inflags;
|
pfds[0].events = inflags;
|
||||||
result = poll(pfds, 1, to);
|
result = poll(pfds, 1, to);
|
||||||
*flags = 0;
|
*flags = 0;
|
||||||
|
|
||||||
|
if (rc < 0 && errno == EINTR) {
|
||||||
|
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "DAHDI wait got interrupted, trying again\n");
|
||||||
|
goto pollagain;
|
||||||
|
}
|
||||||
|
|
||||||
if (pfds[0].revents & POLLERR) {
|
if (pfds[0].revents & POLLERR) {
|
||||||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_ERROR, "DAHDI device got POLLERR\n");
|
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_ERROR, "DAHDI device got POLLERR\n");
|
||||||
result = -1;
|
result = -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user