From 5a7af00e80b9f360a11fcbbc6c6b6dfd2ee478a6 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Sat, 13 May 2017 16:40:00 +0000 Subject: 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 --- apps/app_externalivr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apps/app_externalivr.c') 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)) { -- cgit v1.2.3