]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
This explicit poll is only needed on mac. In fact, it breaks some systems
authorRussell Bryant <russell@russellbryant.com>
Fri, 19 May 2006 19:01:17 +0000 (19:01 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 19 May 2006 19:01:17 +0000 (19:01 +0000)
such as some versions of Fedora, causing 'asterisk -rx' to never exit.  This
has been tested on systems showing the asterisk -rx problem, as well as other
unaffected versions of linux, mac osx 10.4, and FreeBSD 6.
(issue #7071)

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

asterisk.c

index 334d322df4575b1198c7609c37c0bbcd6334d7df..c0605f036c2c4a357ab979bdcd8f040ca419287f 100644 (file)
@@ -1803,13 +1803,17 @@ static void ast_remotecontrol(char * data)
 
        if (option_exec && data) {  /* hack to print output then exit if asterisk -rx is used */
                char tempchar;
+#ifdef __Darwin__
                struct pollfd fds[0];
                fds[0].fd = ast_consock;
                fds[0].events = POLLIN;
                fds[0].revents = 0;
-               while(poll(fds, 1, 100) > 0) {
+               while (poll(fds, 1, 100) > 0) {
                        ast_el_read_char(el, &tempchar);
                }
+#else
+               while (!ast_el_read_char(el, &tempchar));
+#endif
                return;
        }
        for(;;) {