aboutsummaryrefslogtreecommitdiffstats
path: root/pbx
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 /pbx
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 'pbx')
-rw-r--r--pbx/pbx_config.c7
-rw-r--r--pbx/pbx_dundi.c4
-rw-r--r--pbx/pbx_gtkconsole.c6
-rw-r--r--pbx/pbx_loopback.c5
-rw-r--r--pbx/pbx_realtime.c5
-rw-r--r--pbx/pbx_spool.c6
6 files changed, 17 insertions, 16 deletions
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c
index 5c97f8bf7..4a7a3d368 100644
--- a/pbx/pbx_config.c
+++ b/pbx/pbx_config.c
@@ -1639,7 +1639,7 @@ static int pbx_load_module(void)
pbx_set_autofallthrough(autofallthrough_config);
pbx_set_extenpatternmatchnew(extenpatternmatchnew_config);
- return 0;
+ return AST_MODULE_LOAD_SUCCESS;
}
static int load_module(void)
@@ -1651,15 +1651,14 @@ static int load_module(void)
ast_cli_register(&cli_dialplan_save);
ast_cli_register_multiple(cli_pbx_config, sizeof(cli_pbx_config) / sizeof(struct ast_cli_entry));
- return 0;
+ return AST_MODULE_LOAD_SUCCESS;
}
static int reload(void)
{
if (clearglobalvars_config)
pbx_builtin_clear_globals();
- pbx_load_module();
- return 0;
+ return pbx_load_module();
}
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Text Extension Configuration",
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c
index fe1fec749..62e55abf9 100644
--- a/pbx/pbx_dundi.c
+++ b/pbx/pbx_dundi.c
@@ -4779,9 +4779,9 @@ static int reload(void)
struct sockaddr_in sin;
if (set_config("dundi.conf", &sin, 1))
- return -1;
+ return AST_MODULE_LOAD_FAILURE;
- return 0;
+ return AST_MODULE_LOAD_SUCCESS;
}
static int load_module(void)
diff --git a/pbx/pbx_gtkconsole.c b/pbx/pbx_gtkconsole.c
index 9017d7459..2cf466526 100644
--- a/pbx/pbx_gtkconsole.c
+++ b/pbx/pbx_gtkconsole.c
@@ -230,7 +230,7 @@ static int reload_module(void *mod)
}
}
- return 0;
+ return AST_MODULE_LOAD_SUCCESS;
}
static void file_ok_sel(GtkWidget *w, GtkFileSelection *fs)
@@ -473,7 +473,7 @@ static int load_module(void *mod)
{
if (pipe(clipipe)) {
ast_log(LOG_WARNING, "Unable to create CLI pipe\n");
- return -1;
+ return AST_MODULE_LOAD_FAILURE;
}
g_thread_init(NULL);
if (gtk_init_check(NULL, NULL)) {
@@ -489,7 +489,7 @@ static int load_module(void *mod)
else
ast_verb(2, "GTK is not available -- skipping monitor\n");
}
- return 0;
+ return AST_MODULE_LOAD_SUCCESS;
}
static const char *description(void)
diff --git a/pbx/pbx_loopback.c b/pbx/pbx_loopback.c
index 11fe8c3ff..e6f4ed904 100644
--- a/pbx/pbx_loopback.c
+++ b/pbx/pbx_loopback.c
@@ -168,8 +168,9 @@ static int unload_module(void)
static int load_module(void)
{
- ast_register_switch(&loopback_switch);
- return 0;
+ if (ast_register_switch(&loopback_switch))
+ return AST_MODULE_LOAD_FAILURE;
+ return AST_MODULE_LOAD_SUCCESS;
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Loopback Switch");
diff --git a/pbx/pbx_realtime.c b/pbx/pbx_realtime.c
index 0b122b04c..6b9a0fbff 100644
--- a/pbx/pbx_realtime.c
+++ b/pbx/pbx_realtime.c
@@ -243,8 +243,9 @@ static int unload_module(void)
static int load_module(void)
{
- ast_register_switch(&realtime_switch);
- return 0;
+ if (ast_register_switch(&realtime_switch))
+ return AST_MODULE_LOAD_FAILURE;
+ return AST_MODULE_LOAD_SUCCESS;
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Realtime Switch");
diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c
index c4cd739ad..113fc2b73 100644
--- a/pbx/pbx_spool.c
+++ b/pbx/pbx_spool.c
@@ -494,16 +494,16 @@ static int load_module(void)
snprintf(qdir, sizeof(qdir), "%s/%s", ast_config_AST_SPOOL_DIR, "outgoing");
if (ast_mkdir(qdir, 0777)) {
ast_log(LOG_WARNING, "Unable to create queue directory %s -- outgoing spool disabled\n", qdir);
- return 0;
+ return AST_MODULE_LOAD_DECLINE;
}
snprintf(qdonedir, sizeof(qdir), "%s/%s", ast_config_AST_SPOOL_DIR, "outgoing_done");
if ((ret = ast_pthread_create_detached_background(&thread, NULL, scan_thread, NULL))) {
ast_log(LOG_WARNING, "Unable to create thread :( (returned error: %d)\n", ret);
- return -1;
+ return AST_MODULE_LOAD_FAILURE;
}
- return 0;
+ return AST_MODULE_LOAD_SUCCESS;
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Outgoing Spool Support");