提交 dab7d83e authored 作者: Brian West's avatar Brian West 提交者: Andrey Volk

FS-10634: [core] Fix switch_channel_wait_for_app_flag from previous commit

上级 d355a572
...@@ -1752,17 +1752,19 @@ SWITCH_DECLARE(switch_status_t) switch_channel_wait_for_app_flag(switch_channel_ ...@@ -1752,17 +1752,19 @@ SWITCH_DECLARE(switch_status_t) switch_channel_wait_for_app_flag(switch_channel_
uint32_t app_flag, uint32_t app_flag,
const char *key, switch_bool_t pres, uint32_t to) const char *key, switch_bool_t pres, uint32_t to)
{ {
int r = 0;
if (to) { if (to) {
to++; to++;
} }
for (;;) { for (;;) {
if (pres) { if (pres) {
if (switch_channel_test_app_flag_key(key, channel, app_flag)) { if ((r = switch_channel_test_app_flag_key(key, channel, app_flag))) {
break; break;
} }
} else { } else {
if (!switch_channel_test_app_flag_key(key, channel, app_flag)) { if (!(r = switch_channel_test_app_flag_key(key, channel, app_flag))) {
break; break;
} }
} }
...@@ -1770,15 +1772,15 @@ SWITCH_DECLARE(switch_status_t) switch_channel_wait_for_app_flag(switch_channel_ ...@@ -1770,15 +1772,15 @@ SWITCH_DECLARE(switch_status_t) switch_channel_wait_for_app_flag(switch_channel_
switch_cond_next(); switch_cond_next();
if (switch_channel_down(channel)) { if (switch_channel_down(channel)) {
return SWITCH_STATUS_FALSE; return r;
} }
if (to && !--to) { if (to && !--to) {
return SWITCH_STATUS_FALSE; return r;
} }
} }
return SWITCH_STATUS_SUCCESS; return r;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论