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:01 +0000
commit161820396495a549c9a378d32136cbb5f28ef2af (patch)
treed6df892de3055d9765d58d5592ec33b6e4676d20 /apps/app_externalivr.c
parent6383d9214aaba9a7ace1753ff0f6dfe1f2c6c5fa (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 9cb8839db..b661a2ec9 100644
--- a/apps/app_externalivr.c
+++ b/apps/app_externalivr.c
@@ -645,9 +645,9 @@ static int eivr_comm(struct ast_channel *chan, struct ivr_localuser *u,
setvbuf(eivr_errors, NULL, _IONBF, 0);
}
- 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)) {