summaryrefslogtreecommitdiff
path: root/channel.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2005-04-22 01:40:23 +0000
committerKevin P. Fleming <kpfleming@digium.com>2005-04-22 01:40:23 +0000
commite1d1a962c74e0f77de3881a5fbdb0f50809eda64 (patch)
tree5da5096a23fdca1550fd67fd3aaa9ee8b411260a /channel.c
parenta729a57ba121061fd42f5dd4f557ed1f18d6dc99 (diff)
initialize errno and don't report an error when poll() returns without indicating one (bug #4059)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5492 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channel.c')
-rwxr-xr-xchannel.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/channel.c b/channel.c
index d08bc42f6..519281176 100755
--- a/channel.c
+++ b/channel.c
@@ -1251,9 +1251,10 @@ char ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int cmdfd
return -1;
/* Wait for a digit, no more than ms milliseconds total. */
while(ms) {
+ errno = 0;
rchan = ast_waitfor_nandfds(&c, 1, &cmdfd, (cmdfd > -1) ? 1 : 0, NULL, &outfd, &ms);
if ((!rchan) && (outfd < 0) && (ms)) {
- if (errno == EINTR)
+ if (errno == 0 || errno == EINTR)
continue;
ast_log(LOG_WARNING, "Wait failed (%s)\n", strerror(errno));
return -1;