summaryrefslogtreecommitdiff
path: root/apps/app_externalivr.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-05-13 16:40:00 +0000
committerJoshua Colp <jcolp@digium.com>2017-05-16 14:25:23 +0000
commit5a7af00e80b9f360a11fcbbc6c6b6dfd2ee478a6 (patch)
tree6f5b088ad13c1451d1e8421e57b9cd1a9a2d3434 /apps/app_externalivr.c
parentce4d8dac91631599452a9c7aa9c81001704afb62 (diff)
asterisk: Audit locking of channel when manipulating flags.
When manipulating flags on a channel the channel has to be locked to guarantee that nothing else is also manipulating the flags. This change introduces locking where necessary to guarantee this. It also adds helper functions that manipulate channel flags and lock to reduce repeated code. ASTERISK-26789 Change-Id: I489280662dba0f4c50981bfc5b5a7073fef2db10
Diffstat (limited to 'apps/app_externalivr.c')
-rw-r--r--apps/app_externalivr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c
index c2224b44b..84267a5ea 100644
--- a/apps/app_externalivr.c
+++ b/apps/app_externalivr.c
@@ -642,9 +642,9 @@ static int eivr_comm(struct ast_channel *chan, struct ivr_localuser *u,
waitfds[0] = ast_iostream_get_fd(eivr_commands);
waitfds[1] = eivr_errors ? ast_iostream_get_fd(eivr_errors) : -1;
- while (1) {
- if (ast_test_flag(ast_channel_flags(chan), AST_FLAG_ZOMBIE)) {
- ast_chan_log(LOG_ERROR, chan, "Is a zombie\n");
+ while (1) {
+ if (ast_test_flag(ast_channel_flags(chan), AST_FLAG_ZOMBIE)) {
+ ast_chan_log(LOG_ERROR, chan, "Is a zombie\n");
break;
}
if (!hangup_info_sent && !(ast_test_flag(&flags, run_dead)) && ast_check_hangup(chan)) {