aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-26 20:02:27 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-26 20:02:27 +0000
commitdf53774db69f044643962a9f6af6290b3d2ee71d (patch)
tree3713c05a6de35fa07fef058395c44f56f2b0e69d /apps
parent4d04a3258e50f0c5d5103bd9eef6cec335d93056 (diff)
Use defined return values in load_module in more places.
(closes issue #11096) Patches: pbx_config.c.patch uploaded by moy (license 222) pbx_dundi.c.patch uploaded by moy (license 222) pbx_gtkconsole.c.patch uploaded by moy (license 222) pbx_loopback.c.patch uploaded by moy (license 222) pbx_realtime.c.patch uploaded by moy (license 222) pbx_spool.c.patch uploaded by moy (license 222) app_adsiprog.c.patch uploaded by moy (license 222) app_alarmreceiver.c.patch uploaded by moy (license 222) app_amd.c.patch uploaded by moy (license 222) app_authenticate.c.patch uploaded by moy (license 222) app_cdr.c.patch uploaded by moy (license 222) app_zapateller.c.patch uploaded by moy (license 222) app_zapbarge.c.patch uploaded by moy (license 222) app_zapras.c.patch uploaded by moy (license 222) app_zapscan.c.patch uploaded by moy (license 222) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@94806 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_adsiprog.c4
-rw-r--r--apps/app_alarmreceiver.c7
-rw-r--r--apps/app_amd.c20
-rw-r--r--apps/app_authenticate.c4
-rw-r--r--apps/app_cdr.c4
-rw-r--r--apps/app_zapateller.c2
-rw-r--r--apps/app_zapbarge.c2
-rw-r--r--apps/app_zapras.c2
-rw-r--r--apps/app_zapscan.c2
9 files changed, 30 insertions, 17 deletions
diff --git a/apps/app_adsiprog.c b/apps/app_adsiprog.c
index 118b5a107..1b09ce7b5 100644
--- a/apps/app_adsiprog.c
+++ b/apps/app_adsiprog.c
@@ -1573,7 +1573,9 @@ static int unload_module(void)
static int load_module(void)
{
- return ast_register_application(app, adsi_exec, synopsis, descrip);
+ if (ast_register_application(app, adsi_exec, synopsis, descrip))
+ return AST_MODULE_LOAD_FAILURE;
+ return AST_MODULE_LOAD_SUCCESS;
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Asterisk ADSI Programming Application");
diff --git a/apps/app_alarmreceiver.c b/apps/app_alarmreceiver.c
index 5a990d9d5..c4fa81109 100644
--- a/apps/app_alarmreceiver.c
+++ b/apps/app_alarmreceiver.c
@@ -801,8 +801,11 @@ static int unload_module(void)
static int load_module(void)
{
- if(load_config())
- return ast_register_application(app, alarmreceiver_exec, synopsis, descrip);
+ if(load_config()) {
+ if (ast_register_application(app, alarmreceiver_exec, synopsis, descrip))
+ return AST_MODULE_LOAD_FAILURE;
+ return AST_MODULE_LOAD_SUCCESS;
+ }
else
return AST_MODULE_LOAD_DECLINE;
}
diff --git a/apps/app_amd.c b/apps/app_amd.c
index 70390f038..556fceec6 100644
--- a/apps/app_amd.c
+++ b/apps/app_amd.c
@@ -308,7 +308,7 @@ static int amd_exec(struct ast_channel *chan, void *data)
return 0;
}
-static void load_config(int reload)
+static int load_config(int reload)
{
struct ast_config *cfg = NULL;
char *cat = NULL;
@@ -317,9 +317,9 @@ static void load_config(int reload)
if (!(cfg = ast_config_load("amd.conf", config_flags))) {
ast_log(LOG_ERROR, "Configuration file amd.conf missing.\n");
- return;
+ return -1;
} else if (cfg == CONFIG_STATUS_FILEUNCHANGED)
- return;
+ return 0;
cat = ast_category_browse(cfg, NULL);
@@ -360,7 +360,7 @@ static void load_config(int reload)
dfltInitialSilence, dfltGreeting, dfltAfterGreetingSilence, dfltTotalAnalysisTime,
dfltMinimumWordLength, dfltBetweenWordsSilence, dfltMaximumNumberOfWords, dfltSilenceThreshold );
- return;
+ return 0;
}
static int unload_module(void)
@@ -370,14 +370,18 @@ static int unload_module(void)
static int load_module(void)
{
- load_config(0);
- return ast_register_application(app, amd_exec, synopsis, descrip);
+ if (load_config(0))
+ return AST_MODULE_LOAD_DECLINE;
+ if (ast_register_application(app, amd_exec, synopsis, descrip))
+ return AST_MODULE_LOAD_FAILURE;
+ return AST_MODULE_LOAD_SUCCESS;
}
static int reload(void)
{
- load_config(1);
- return 0;
+ if (load_config(1))
+ return AST_MODULE_LOAD_DECLINE;
+ return AST_MODULE_LOAD_SUCCESS;
}
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Answering Machine Detection Application",
diff --git a/apps/app_authenticate.c b/apps/app_authenticate.c
index 1a49bf337..3a3e7582e 100644
--- a/apps/app_authenticate.c
+++ b/apps/app_authenticate.c
@@ -204,7 +204,9 @@ static int unload_module(void)
static int load_module(void)
{
- return ast_register_application(app, auth_exec, synopsis, descrip);
+ if (ast_register_application(app, auth_exec, synopsis, descrip))
+ return AST_MODULE_LOAD_FAILURE;
+ return AST_MODULE_LOAD_SUCCESS;
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Authentication Application");
diff --git a/apps/app_cdr.c b/apps/app_cdr.c
index 86b1db219..7804a806b 100644
--- a/apps/app_cdr.c
+++ b/apps/app_cdr.c
@@ -55,7 +55,9 @@ static int unload_module(void)
static int load_module(void)
{
- return ast_register_application(nocdr_app, nocdr_exec, nocdr_synopsis, nocdr_descrip);
+ if (ast_register_application(nocdr_app, nocdr_exec, nocdr_synopsis, nocdr_descrip))
+ return AST_MODULE_LOAD_FAILURE;
+ return AST_MODULE_LOAD_SUCCESS;
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Tell Asterisk to not maintain a CDR for the current call");
diff --git a/apps/app_zapateller.c b/apps/app_zapateller.c
index 74c458c55..2641e69b4 100644
--- a/apps/app_zapateller.c
+++ b/apps/app_zapateller.c
@@ -107,7 +107,7 @@ static int unload_module(void)
static int load_module(void)
{
- return ast_register_application(app, zapateller_exec, synopsis, descrip);
+ return ((ast_register_application(app, zapateller_exec, synopsis, descrip)) ? AST_MODULE_LOAD_FAILURE : AST_MODULE_LOAD_SUCCESS);
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Block Telemarketers with Special Information Tone");
diff --git a/apps/app_zapbarge.c b/apps/app_zapbarge.c
index 9e2ff67fc..bb8c4cbb3 100644
--- a/apps/app_zapbarge.c
+++ b/apps/app_zapbarge.c
@@ -293,7 +293,7 @@ static int unload_module(void)
static int load_module(void)
{
- return ast_register_application(app, conf_exec, synopsis, descrip);
+ return ((ast_register_application(app, conf_exec, synopsis, descrip)) ? AST_MODULE_LOAD_FAILURE : AST_MODULE_LOAD_SUCCESS);
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Barge in on Zap channel application");
diff --git a/apps/app_zapras.c b/apps/app_zapras.c
index bc3b51dba..480e5f643 100644
--- a/apps/app_zapras.c
+++ b/apps/app_zapras.c
@@ -231,7 +231,7 @@ static int unload_module(void)
static int load_module(void)
{
- return ast_register_application(app, zapras_exec, synopsis, descrip);
+ return ((ast_register_application(app, zapras_exec, synopsis, descrip)) ? AST_MODULE_LOAD_FAILURE : AST_MODULE_LOAD_SUCCESS);
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Zaptel ISDN Remote Access Server");
diff --git a/apps/app_zapscan.c b/apps/app_zapscan.c
index 99f24b8a9..5367d99d1 100644
--- a/apps/app_zapscan.c
+++ b/apps/app_zapscan.c
@@ -356,7 +356,7 @@ static int unload_module(void)
static int load_module(void)
{
- return ast_register_application(app, conf_exec, synopsis, descrip);
+ return ((ast_register_application(app, conf_exec, synopsis, descrip)) ? AST_MODULE_LOAD_FAILURE : AST_MODULE_LOAD_SUCCESS);
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Scan Zap channels application");