Fix manager EINTR issue (bug #5247)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6644 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2005-09-25 16:58:56 +00:00
parent fcc0b23e18
commit 9804f96c0f

View File

@@ -1311,8 +1311,11 @@ static int get_input(struct mansession *s, char *output)
} }
fds[0].fd = s->fd; fds[0].fd = s->fd;
fds[0].events = POLLIN; fds[0].events = POLLIN;
do {
res = poll(fds, 1, -1); res = poll(fds, 1, -1);
if (res < 0) { if (res < 0) {
if (errno == EINTR)
continue;
ast_log(LOG_WARNING, "Select returned error: %s\n", strerror(errno)); ast_log(LOG_WARNING, "Select returned error: %s\n", strerror(errno));
return -1; return -1;
} else if (res > 0) { } else if (res > 0) {
@@ -1321,7 +1324,9 @@ static int get_input(struct mansession *s, char *output)
ast_mutex_unlock(&s->lock); ast_mutex_unlock(&s->lock);
if (res < 1) if (res < 1)
return -1; return -1;
break;
} }
} while(1);
s->inlen += res; s->inlen += res;
s->inbuf[s->inlen] = '\0'; s->inbuf[s->inlen] = '\0';
return 0; return 0;