From: Kevin P. Fleming Date: Thu, 23 Mar 2006 21:16:46 +0000 (+0000) Subject: ensure global variables lock is held during 'show globals' CLI command X-Git-Tag: 1.4.0-beta1~2347 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be537d95eba7f75e614902a2ad5668e8e8334510;p=thirdparty%2Fasterisk.git ensure global variables lock is held during 'show globals' CLI command git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@14519 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/pbx.c b/pbx.c index f48ce951ee..278c180287 100644 --- a/pbx.c +++ b/pbx.c @@ -3423,12 +3423,14 @@ static int handle_show_globals(int fd, int argc, char *argv[]) int i = 0; struct ast_var_t *newvariable; + ast_mutex_lock(&globalslock); AST_LIST_TRAVERSE (&globals, newvariable, entries) { i++; ast_cli(fd, " %s=%s\n", ast_var_name(newvariable), ast_var_value(newvariable)); } - /* ... we have applications ... */ + ast_mutex_unlock(&globalslock); ast_cli(fd, "\n -- %d variables\n", i); + return RESULT_SUCCESS; }