aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-09 20:13:14 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-09 20:13:14 +0000
commit2b30b408f6b591a838a4d53f84892e86bdc955f0 (patch)
tree4cbdf831b8a6b7714c3d504216c128389aa84f72 /main
parent5cc04b8fdffb0d7d7b18b47c09e8f6cce8e9dc9f (diff)
Merged revisions 97618 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r97618 | qwell | 2008-01-09 14:05:45 -0600 (Wed, 09 Jan 2008) | 1 line Fix some locking and return value funkiness. We really shouldn't be unlocking this lock inside of a function, unless we locked it there too. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@97620 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/cli.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/main/cli.c b/main/cli.c
index c412d63c7..d63411ec1 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -1576,6 +1576,7 @@ static char *handle_help(struct ast_cli_entry *e, int cmd, struct ast_cli_args *
{
char fullcmd[80];
struct ast_cli_entry *my_e;
+ char *res = CLI_SUCCESS;
if (cmd == CLI_INIT) {
e->command = "help";
@@ -1600,8 +1601,11 @@ static char *handle_help(struct ast_cli_entry *e, int cmd, struct ast_cli_args *
AST_RWLIST_RDLOCK(&helpers);
my_e = find_cli(a->argv + 1, 1); /* try exact match first */
- if (!my_e)
- return help1(a->fd, a->argv + 1, 1 /* locked */);
+ if (!my_e) {
+ res = help1(a->fd, a->argv + 1, 1 /* locked */);
+ AST_RWLIST_UNLOCK(&helpers);
+ return res;
+ }
if (my_e->usage)
ast_cli(a->fd, "%s", my_e->usage);
else {
@@ -1609,7 +1613,7 @@ static char *handle_help(struct ast_cli_entry *e, int cmd, struct ast_cli_args *
ast_cli(a->fd, "No help text available for '%s'.\n", fullcmd);
}
AST_RWLIST_UNLOCK(&helpers);
- return CLI_SUCCESS;
+ return res;
}
static char *parse_args(const char *s, int *argc, char *argv[], int max, int *trailingwhitespace)