freetdm: retry polling in DAHDI devices when fails due to interrupted system call

This commit is contained in:
Moises Silva 2010-11-16 23:41:11 -05:00
parent 21e1f69b98
commit 5486b8c74d
1 changed files with 6 additions and 1 deletions

View File

@ -889,13 +889,18 @@ static FIO_WAIT_FUNCTION(zt_wait)
inflags |= POLLPRI;
}
pollagain:
memset(&pfds[0], 0, sizeof(pfds[0]));
pfds[0].fd = ftdmchan->sockfd;
pfds[0].events = inflags;
result = poll(pfds, 1, to);
*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) {
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_ERROR, "DAHDI device got POLLERR\n");
result = -1;