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
This commit is contained in:
parent
dcbc0aab3f
commit
ea3fb96b29
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -336,12 +336,16 @@ static int unload_module(void)
|
|||
|
||||
static int load_module(void)
|
||||
{
|
||||
int res = 0;
|
||||
if (ast_custom_function_register(&agc_function)) {
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
}
|
||||
|
||||
res |= ast_custom_function_register(&agc_function);
|
||||
res |= ast_custom_function_register(&denoise_function);
|
||||
if (ast_custom_function_register(&denoise_function)) {
|
||||
ast_custom_function_unregister(&agc_function);
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
}
|
||||
|
||||
return res;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Noise reduction and Automatic Gain Control (AGC)");
|
||||
|
|
Loading…
Reference in New Issue