From 4a51128f425c947d5eb4b69f561c317ab0ac9de2 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Tue, 29 Jan 2008 18:28:32 +0000 Subject: [PATCH] cleanup git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7423 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- .../applications/mod_commands/mod_commands.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 057c85bdd2..42f458ffe3 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -1274,16 +1274,17 @@ SWITCH_STANDARD_API(break_function) if (switch_strlen_zero(cmd)) { stream->write_function(stream, "-USAGE: %s\n", BREAK_SYNTAX); - } else { - if ((psession = switch_core_session_locate(cmd))) { - switch_channel_t *channel = switch_core_session_get_channel(psession); - switch_channel_set_flag(channel, CF_BREAK); - switch_core_session_rwunlock(psession); - } else { - stream->write_function(stream, "-ERR No Such Channel!\n"); - } + return SWITCH_STATUS_SUCCESS; } + if (!(psession = switch_core_session_locate(cmd))) { + stream->write_function(stream, "-ERR No Such Channel!\n"); + return SWITCH_STATUS_SUCCESS; + } + + switch_channel_set_flag(switch_core_session_get_channel(psession), CF_BREAK); + switch_core_session_rwunlock(psession); + return SWITCH_STATUS_SUCCESS; }