From: Sean Bright Date: Wed, 27 Jul 2011 15:25:53 +0000 (+0000) Subject: Sort the module list so that 'module show' is alphabetical. X-Git-Tag: 10.0.0-beta2~181 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=062da6420988da32e16872da586eb024128076dd;p=thirdparty%2Fasterisk.git Sort the module list so that 'module show' is alphabetical. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@329670 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/loader.c b/main/loader.c index cb88e34634..5fe84449f2 100644 --- a/main/loader.c +++ b/main/loader.c @@ -870,6 +870,12 @@ static enum ast_module_load_result load_resource(const char *resource_name, unsi res = start_resource(mod); } + /* Now make sure that the list is sorted */ + AST_LIST_LOCK(&module_list); + AST_LIST_REMOVE(&module_list, mod, entry); + AST_LIST_INSERT_SORTALPHA(&module_list, mod, entry, resource); + AST_LIST_UNLOCK(&module_list); + return res; }