summaryrefslogtreecommitdiff
path: root/cel
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2017-04-11 10:07:39 -0600
committerGeorge Joseph <gjoseph@digium.com>2017-04-12 15:47:56 -0600
commitcc668bd522fceb9cb6cd0d69f5e29c28f1835b2a (patch)
treef4ea57201c41cde4cf2a326d400eed2e41179b52 /cel
parent0986618c94cbe0e2d95354f867c6cc966758a025 (diff)
modules: change module LOAD_FAILUREs to LOAD_DECLINES
In all non-pbx modules, AST_MODULE_LOAD_FAILURE has been changed to AST_MODULE_LOAD_DECLINE. This prevents asterisk from exiting if a module can't be loaded. If the user wishes to retain the FAILURE behavior for a specific module, they can use the "require" or "preload-require" keyword in modules.conf. A new API was added to logger: ast_is_logger_initialized(). This allows asterisk.c/check_init() to print to the error log once the logger subsystem is ready instead of just to stdout. If something does fail before the logger is initialized, we now print to stderr instead of stdout. Change-Id: I5f4b50623d9b5a6cb7c5624a8c5c1274c13b2b25
Diffstat (limited to 'cel')
-rw-r--r--cel/cel_custom.c7
-rw-r--r--cel/cel_odbc.c7
2 files changed, 8 insertions, 6 deletions
diff --git a/cel/cel_custom.c b/cel/cel_custom.c
index f75efdd4b..09aef4e9a 100644
--- a/cel/cel_custom.c
+++ b/cel/cel_custom.c
@@ -193,14 +193,15 @@ static enum ast_module_load_result load_module(void)
{
if (AST_RWLIST_WRLOCK(&sinks)) {
ast_log(LOG_ERROR, "Unable to lock sink list. Load failed.\n");
- return AST_MODULE_LOAD_FAILURE;
+ return AST_MODULE_LOAD_DECLINE;
}
load_config();
AST_RWLIST_UNLOCK(&sinks);
if (ast_cel_backend_register(CUSTOM_BACKEND_NAME, custom_log)) {
- return AST_MODULE_LOAD_FAILURE;
+ free_config();
+ return AST_MODULE_LOAD_DECLINE;
}
return AST_MODULE_LOAD_SUCCESS;
}
@@ -209,7 +210,7 @@ static int reload(void)
{
if (AST_RWLIST_WRLOCK(&sinks)) {
ast_log(LOG_ERROR, "Unable to lock sink list. Load failed.\n");
- return AST_MODULE_LOAD_FAILURE;
+ return AST_MODULE_LOAD_DECLINE;
}
free_config();
diff --git a/cel/cel_odbc.c b/cel/cel_odbc.c
index a10aadae9..1ea6ea987 100644
--- a/cel/cel_odbc.c
+++ b/cel/cel_odbc.c
@@ -803,13 +803,14 @@ static int load_module(void)
if (AST_RWLIST_WRLOCK(&odbc_tables)) {
ast_log(LOG_ERROR, "Unable to lock column list. Load failed.\n");
- return AST_MODULE_LOAD_FAILURE;
+ return AST_MODULE_LOAD_DECLINE;
}
load_config();
AST_RWLIST_UNLOCK(&odbc_tables);
if (ast_cel_backend_register(ODBC_BACKEND_NAME, odbc_log)) {
ast_log(LOG_ERROR, "Unable to subscribe to CEL events\n");
- return AST_MODULE_LOAD_FAILURE;
+ free_config();
+ return AST_MODULE_LOAD_DECLINE;
}
return AST_MODULE_LOAD_SUCCESS;
}
@@ -818,7 +819,7 @@ static int reload(void)
{
if (AST_RWLIST_WRLOCK(&odbc_tables)) {
ast_log(LOG_ERROR, "Unable to lock column list. Reload failed.\n");
- return AST_MODULE_LOAD_FAILURE;
+ return AST_MODULE_LOAD_DECLINE;
}
free_config();