mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-03 19:16:46 +00:00
loader: Flag module as declined in all cases where it fails to load.
This has no effect on startup since AST_MODULE_LOAD_FAILURE aborts startup, but it's possible for this code to be returned on manual load of a module after startup. It is an error for a module to not have a load callback but this is not a fatal system error. In this case flag the module as declined, return AST_MODULE_LOAD_FAILURE only if a required module is broken. Expand doxygen documentation for AST_MODULE_LOAD_*. Change-Id: I3c030bb917f6e5a0dfd9d91491a4661b348cabf8
This commit is contained in:
@@ -1545,7 +1545,9 @@ static enum ast_module_load_result start_resource(struct ast_module *mod)
|
||||
}
|
||||
|
||||
if (!mod->info->load) {
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
mod->flags.declined = 1;
|
||||
|
||||
return mod->flags.required ? AST_MODULE_LOAD_FAILURE : AST_MODULE_LOAD_DECLINE;
|
||||
}
|
||||
|
||||
if (module_deps_reference(mod, NULL)) {
|
||||
@@ -1593,6 +1595,8 @@ static enum ast_module_load_result start_resource(struct ast_module *mod)
|
||||
}
|
||||
break;
|
||||
case AST_MODULE_LOAD_FAILURE:
|
||||
mod->flags.declined = 1;
|
||||
break;
|
||||
case AST_MODULE_LOAD_SKIP: /* modules should never return this value */
|
||||
case AST_MODULE_LOAD_PRIORITY:
|
||||
break;
|
||||
|
Reference in New Issue
Block a user