git-svn-id: http://svn.openzap.org/svn/openzap/trunk@133 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Anthony Minessale 2007-05-24 13:39:40 +00:00
parent 74b55a890e
commit df76bafd6d
2 changed files with 9 additions and 4 deletions

View File

@ -201,7 +201,6 @@ static void *zap_analog_run(zap_thread_t *me, void *obj)
status = zap_span_poll_event(span, waitms);
switch(status) {
case ZAP_TIMEOUT:
case ZAP_SUCCESS:
{
zap_event_t *event;

View File

@ -416,20 +416,26 @@ static ZIO_WAIT_FUNCTION(wanpipe_wait)
ZIO_SPAN_POLL_EVENT_FUNCTION(wanpipe_poll_event)
{
struct pollfd pfds[ZAP_MAX_CHANNELS_SPAN];
int i, j = 0, k = 0, r;
int i, j = 0, k = 0, l = 0, r;
for(i = 1; i <= span->chan_count; i++) {
memset(&pfds[j], 0, sizeof(pfds[j]));
pfds[j].fd = span->channels[i].sockfd;
pfds[j].events = POLLPRI;
//printf("set %d=%d\n", j, pfds[j].fd);
if (zap_test_flag((&span->channels[i]), ZAP_CHANNEL_WINK) || zap_test_flag((&span->channels[i]), ZAP_CHANNEL_FLASH)) {
l++;
}
j++;
}
if (l) {
ms = 5;
}
r = poll(pfds, j, ms);
if (r == 0) {
return ZAP_TIMEOUT;
return l ? ZAP_SUCCESS : ZAP_TIMEOUT;
} else if (r < 0) {
snprintf(span->last_error, sizeof(span->last_error), "%s", strerror(errno));
return ZAP_FAIL;