summaryrefslogtreecommitdiff
path: root/res/res_corosync.c
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2015-06-26 22:02:42 -0500
committerMatt Jordan <mjordan@digium.com>2015-06-26 22:06:06 -0500
commit80d97290bbc09d02ababa657450c24cf21b93e6b (patch)
treecb8cc8c4461fa2b9d6ba3d9c327f70833ae318e8 /res/res_corosync.c
parent99b1aa6d26ffa3a359de274cae389d4ce627ffa8 (diff)
res/res_corosync: Always decline module load, instead of failing
Returns a 'failure' from the module load routine indicates to Asterisk that it should abort loading completely. This is rarely - in fact, really, never - a good option. Aborting load of Asterisk from a dynamic module implies that the core, and the rest of the dynamic modules, don't matter: we should abandon all processing. res_corosync is really not that important. This patch updates the module such that, if it fails to load, it politely declines (emitting ERROR messages along the way), and allows Asterisk to continue to function. Note that this issue was keeping Asterisk unit tests from running on certain build agents. Change-Id: I252249e81fb9b1a68e0da873f54f47e21d648f0f
Diffstat (limited to 'res/res_corosync.c')
-rw-r--r--res/res_corosync.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/res/res_corosync.c b/res/res_corosync.c
index 0b3a61f62..6642acd2c 100644
--- a/res/res_corosync.c
+++ b/res/res_corosync.c
@@ -863,7 +863,6 @@ static void cleanup_module(void)
static int load_module(void)
{
cs_error_t cs_err;
- enum ast_module_load_result res = AST_MODULE_LOAD_FAILURE;
struct cpg_name name;
corosync_aggregate_topic = stasis_topic_create("corosync_aggregate_topic");
@@ -885,7 +884,6 @@ static int load_module(void)
if (load_config(0)) {
/* simply not configured is not a fatal error */
- res = AST_MODULE_LOAD_DECLINE;
goto failed;
}
@@ -926,7 +924,7 @@ static int load_module(void)
failed:
cleanup_module();
- return res;
+ return AST_MODULE_LOAD_DECLINE;
}
static int unload_module(void)