aboutsummaryrefslogtreecommitdiffstats
path: root/asterisk.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-13 03:55:11 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-13 03:55:11 +0000
commitfbd413856b9ea110ca22c95e0a06f7e0fe19a109 (patch)
tree9a3027036370c33b01e63706cdd65eea70b6a792 /asterisk.c
parent6088f66ae9ea7e08783832b3595f0e02fa20d5d6 (diff)
revert a change that caused more problems than it fixed and fix the real
problem in this code. fds was declared as an array of zero size which caused some weird problems, some of which would only be seen when compiling without optimizations. (fixes issues #7071, #7326, and #7305) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@33753 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'asterisk.c')
-rw-r--r--asterisk.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/asterisk.c b/asterisk.c
index c0605f036..b10dcba10 100644
--- a/asterisk.c
+++ b/asterisk.c
@@ -1803,17 +1803,12 @@ 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) {
+ struct pollfd fds;
+ fds.fd = ast_consock;
+ fds.events = POLLIN;
+ fds.revents = 0;
+ while (poll(&fds, 1, 100) > 0)
ast_el_read_char(el, &tempchar);
- }
-#else
- while (!ast_el_read_char(el, &tempchar));
-#endif
return;
}
for(;;) {