From: Russell Bryant Date: Thu, 12 May 2005 02:42:48 +0000 (+0000) Subject: initialize errno and don't report an error when poll() returns without indicating... X-Git-Tag: 1.0.11.1~128 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f5dbaf7ecd6d430ec0104f67e2e382abfdf7898;p=thirdparty%2Fasterisk.git 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/branches/v1-0@5635 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channel.c b/channel.c index 92d9e31b5a..f88dcf73b3 100755 --- a/channel.c +++ b/channel.c @@ -1144,9 +1144,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;