diff options
author | Russell Bryant <russell@russellbryant.com> | 2008-05-13 17:42:17 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2008-05-13 17:42:17 +0000 |
commit | ea3fb96b29fe937b1e82a61ad03e77e8a50a62fd (patch) | |
tree | 30a7dd80f86d8a2a1565249bf10089e05453caa1 /apps | |
parent | dcbc0aab3f0ab632ac090729ec68550196298fa0 (diff) |
Re-introduce proper error handling that was removed in recent commits.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_jack.c | 12 | ||||
-rw-r--r-- | apps/app_skel.c | 3 |
2 files changed, 10 insertions, 5 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"); diff --git a/apps/app_skel.c b/apps/app_skel.c index 061f1e87c..588563d2f 100644 --- a/apps/app_skel.c +++ b/apps/app_skel.c @@ -114,7 +114,8 @@ static int unload_module(void) static int load_module(void) { - return ast_register_application(app, app_exec, synopsis, descrip); + return ast_register_application(app, app_exec, synopsis, descrip) ? + AST_MODULE_LOAD_DECLINE : AST_MODULE_LOAD_SUCCESS; } AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Skeleton (sample) Application"); |