]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10634: [core] Fix switch_channel_wait_for_app_flag from previous commit
authorBrian West <brian@freeswitch.org>
Mon, 17 Jun 2019 16:02:51 +0000 (11:02 -0500)
committerAndrey Volk <andywolk@gmail.com>
Wed, 17 Jul 2019 20:33:02 +0000 (00:33 +0400)
src/switch_channel.c

index 934db1e0471f890c0189d255652335a03cf13d9b..c5c61d43ae5c7b814e0e79bec165a54f91fff3af 100644 (file)
@@ -1752,17 +1752,19 @@ SWITCH_DECLARE(switch_status_t) switch_channel_wait_for_app_flag(switch_channel_
                                                                                                                                 uint32_t app_flag,
                                                                                                                                 const char *key, switch_bool_t pres, uint32_t to)
 {
+       int r = 0;
+       
        if (to) {
                to++;
        }
 
        for (;;) {
                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;
                        }
                } 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;
                        }
                }
@@ -1770,15 +1772,15 @@ SWITCH_DECLARE(switch_status_t) switch_channel_wait_for_app_flag(switch_channel_
                switch_cond_next();
 
                if (switch_channel_down(channel)) {
-                       return SWITCH_STATUS_FALSE;
+                       return r;
                }
 
                if (to && !--to) {
-                       return SWITCH_STATUS_FALSE;
+                       return r;
                }
        }
 
-       return SWITCH_STATUS_SUCCESS;
+       return r;
 }