aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_jack.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-13 17:42:17 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-13 17:42:17 +0000
commita505dcedc68ec4f23ede2264059f449e0b5684ab (patch)
tree30a7dd80f86d8a2a1565249bf10089e05453caa1 /apps/app_jack.c
parent85062e5137aba4e9dd1ca13c46b08ae7cb507924 (diff)
Re-introduce proper error handling that was removed in recent commits.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@115850 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_jack.c')
-rw-r--r--apps/app_jack.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/app_jack.c b/apps/app_jack.c
index 2aa253f9b..1b5f4e738 100644
--- a/apps/app_jack.c
+++ b/apps/app_jack.c
@@ -977,12 +977,16 @@ static int unload_module(void)
static int load_module(void)
{
- int res = 0;
+ if (ast_register_application(jack_app, jack_exec, jack_synopsis, jack_desc)) {
+ return AST_MODULE_LOAD_DECLINE;
+ }
- res |= ast_register_application(jack_app, jack_exec, jack_synopsis, jack_desc);
- res |= ast_custom_function_register(&jack_hook_function);
+ if (ast_custom_function_register(&jack_hook_function)) {
+ ast_unregister_application(jack_app);
+ return AST_MODULE_LOAD_DECLINE;
+ }
- return res;
+ return AST_MODULE_LOAD_SUCCESS;
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "JACK Interface");