diff options
author | bbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-09 18:51:52 +0000 |
---|---|---|
committer | bbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-09 18:51:52 +0000 |
commit | 722eb3c4c3cfa1c0cee915c949c5f95199ee24dd (patch) | |
tree | 25683963c5e51bdedd6211cd0ea92a85639505c3 /res/res_ais.c | |
parent | 815b5b09da5e555add7bba3d8fca588e7611248a (diff) |
Merged revisions 285710 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2
........
r285710 | bbryant | 2010-09-09 14:50:13 -0400 (Thu, 09 Sep 2010) | 8 lines
Fixes an issue with dialplan pattern matching where the specificity for pattern ranges and pattern special characters was inconsistent.
(closes issue #16903)
Reported by: Nick_Lewis
Patches:
pbx.c-specificity.patch uploaded by Nick Lewis (license 657)
Tested by: Nick_Lewis
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@285711 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_ais.c')
-rw-r--r-- | res/res_ais.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/res/res_ais.c b/res/res_ais.c index adb3290e1..9bcceeade 100644 --- a/res/res_ais.c +++ b/res/res_ais.c @@ -113,9 +113,9 @@ const char *ais_err2str(SaAisErrorT error) static void *dispatch_thread_handler(void *data) { - SaSelectionObjectT clm_fd, evt_fd, max_fd; + SaSelectionObjectT clm_fd, evt_fd; int res; - fd_set read_fds; + struct pollfd pfd[2] = { { .events = POLLIN, }, { .events = POLLIN, } }; SaAisErrorT ais_res; ais_res = saClmSelectionObjectGet(clm_handle, &clm_fd); @@ -132,24 +132,26 @@ static void *dispatch_thread_handler(void *data) return NULL; } - max_fd = clm_fd > evt_fd ? clm_fd : evt_fd; + pfd[0].fd = clm_fd; + pfd[1].fd = evt_fd; while (!dispatch_thread.stop) { - FD_ZERO(&read_fds); - FD_SET(clm_fd, &read_fds); - FD_SET(evt_fd, &read_fds); + pfd[0].revents = 0; + pfd[1].revents = 0; - res = ast_select(max_fd + 1, &read_fds, NULL, NULL, NULL); + res = ast_poll(pfd, 2, -1); if (res == -1 && errno != EINTR && errno != EAGAIN) { ast_log(LOG_ERROR, "Select error (%s) dispatch thread going away now, " "and the module will no longer operate.\n", strerror(errno)); break; } - if (FD_ISSET(clm_fd, &read_fds)) + if (pfd[0].revents & POLLIN) { saClmDispatch(clm_handle, SA_DISPATCH_ALL); - if (FD_ISSET(evt_fd, &read_fds)) + } + if (pfd[1].revents & POLLIN) { saEvtDispatch(evt_handle, SA_DISPATCH_ALL); + } } return NULL; |