diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-22 15:37:55 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-22 15:37:55 +0000 |
commit | 318b1b52c7f4001b59076b8470070557e2f79214 (patch) | |
tree | 468a8c811d412c11c51ee04f398f698b2ec95954 | |
parent | 5bd31b5079065aa2225c459b71c76ccfe3aa7d06 (diff) |
Merged revisions 202410 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r202410 | dvossel | 2009-06-22 10:33:35 -0500 (Mon, 22 Jun 2009) | 5 lines
attempting to load running modules
Modules placed in the priority heap for loading were not properly removed from the linked list. This resulted in some modules attempting to load twice.
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@202411 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | include/asterisk/module.h | 9 | ||||
-rw-r--r-- | main/loader.c | 11 |
2 files changed, 12 insertions, 8 deletions
diff --git a/include/asterisk/module.h b/include/asterisk/module.h index 3445d2c9e..84b651122 100644 --- a/include/asterisk/module.h +++ b/include/asterisk/module.h @@ -58,10 +58,11 @@ enum ast_module_unload_mode { }; enum ast_module_load_result { - AST_MODULE_LOAD_SUCCESS = 0, /*!< Module loaded and configured */ - AST_MODULE_LOAD_DECLINE = 1, /*!< Module is not configured */ - AST_MODULE_LOAD_SKIP = 2, /*!< Module was skipped for some reason */ - AST_MODULE_LOAD_FAILURE = -1, /*!< Module could not be loaded properly */ + AST_MODULE_LOAD_SUCCESS = 0, /*!< Module loaded and configured */ + AST_MODULE_LOAD_DECLINE = 1, /*!< Module is not configured */ + AST_MODULE_LOAD_SKIP = 2, /*!< Module was skipped for some reason */ + AST_MODULE_LOAD_PRIORITY = 3, /*!< Module is not loaded yet, but is added to prioity heap */ + AST_MODULE_LOAD_FAILURE = -1, /*!< Module could not be loaded properly */ }; /*! diff --git a/main/loader.c b/main/loader.c index c6df73ce5..af210014f 100644 --- a/main/loader.c +++ b/main/loader.c @@ -744,9 +744,8 @@ static enum ast_module_load_result start_resource(struct ast_module *mod) mod->flags.declined = 1; break; case AST_MODULE_LOAD_FAILURE: - break; - case AST_MODULE_LOAD_SKIP: - /* modules should never return this value */ + case AST_MODULE_LOAD_SKIP: /* modules should never return this value */ + case AST_MODULE_LOAD_PRIORITY: break; } @@ -808,7 +807,7 @@ static enum ast_module_load_result load_resource(const char *resource_name, unsi if (resource_heap) { ast_heap_push(resource_heap, mod); - res = AST_MODULE_LOAD_SKIP; + res = AST_MODULE_LOAD_PRIORITY; } else { res = start_resource(mod); } @@ -894,6 +893,9 @@ static int load_resource_list(struct load_order *load_order, unsigned int global goto done; case AST_MODULE_LOAD_SKIP: break; + case AST_MODULE_LOAD_PRIORITY: + AST_LIST_REMOVE_CURRENT(entry); + break; } } AST_LIST_TRAVERSE_SAFE_END; @@ -909,6 +911,7 @@ static int load_resource_list(struct load_order *load_order, unsigned int global res = -1; goto done; case AST_MODULE_LOAD_SKIP: + case AST_MODULE_LOAD_PRIORITY: break; } } |