]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Short circuit the loop in autoservice_run if there are no channels to poll.
authorMark Michelson <mmichelson@digium.com>
Fri, 13 Jun 2008 21:44:53 +0000 (21:44 +0000)
committerMark Michelson <mmichelson@digium.com>
Fri, 13 Jun 2008 21:44:53 +0000 (21:44 +0000)
If we continued, then the result would be calling poll() with a NULL
pollfd array. While this is fine with POSIX's poll(2) system call, those
who use Asterisk's internal poll mechanism (Darwin systems) would have
a failed assertion occur when poll is called.

(related to issue #10342)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122713 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/autoservice.c

index a967388cbbb8c261f2afb8d285765c5687bf71c7..a681b0f1d55fad0e1f6d803111a9694abc9ab237 100644 (file)
@@ -106,6 +106,10 @@ static void *autoservice_run(void *ign)
 
                AST_LIST_UNLOCK(&aslist);
 
+               if (!x) {
+                       continue;
+               }
+
                chan = ast_waitfor_n(mons, x, &ms);
                if (!chan) {
                        continue;