summaryrefslogtreecommitdiff
path: root/res/res_agi.c
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2017-12-29 03:57:17 -0500
committerCorey Farrell <git@cfware.com>2018-01-24 13:37:29 -0500
commit527cf5a57033820313356414b971fdf0f4382b21 (patch)
tree44810fb922062b5c2879cad1e9cb49b6d8772a80 /res/res_agi.c
parent7ce34f4e6a8a2bbfc3cfac9a4465eb0f71372205 (diff)
Remove redundant module checks and references.
This removes references that are no longer needed due to automatic references created by module dependencies. In addition this removes most calls to ast_module_check as they were checking modules which are listed as dependencies. Change-Id: I332a6e8383d4c72c8e89d988a184ab8320c4872e
Diffstat (limited to 'res/res_agi.c')
-rw-r--r--res/res_agi.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index 2d0dc2743..0931c1a07 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -3815,8 +3815,6 @@ int AST_OPTIONAL_API_NAME(ast_agi_register)(struct ast_module *mod, agi_command
AST_RWLIST_WRLOCK(&agi_commands);
AST_LIST_INSERT_TAIL(&agi_commands, cmd, list);
AST_RWLIST_UNLOCK(&agi_commands);
- if (mod != ast_module_info->self)
- ast_module_ref(ast_module_info->self);
ast_verb(2, "AGI Command '%s' registered\n",fullcmd);
return 1;
} else {
@@ -3825,7 +3823,7 @@ int AST_OPTIONAL_API_NAME(ast_agi_register)(struct ast_module *mod, agi_command
}
}
-int AST_OPTIONAL_API_NAME(ast_agi_unregister)(struct ast_module *mod, agi_command *cmd)
+int AST_OPTIONAL_API_NAME(ast_agi_unregister)(agi_command *cmd)
{
struct agi_command *e;
int unregistered = 0;
@@ -3837,8 +3835,6 @@ int AST_OPTIONAL_API_NAME(ast_agi_unregister)(struct ast_module *mod, agi_comman
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&agi_commands, e, list) {
if (cmd == e) {
AST_RWLIST_REMOVE_CURRENT(list);
- if (mod != ast_module_info->self)
- ast_module_unref(ast_module_info->self);
#ifdef AST_XML_DOCS
if (e->docsrc == AST_XML_DOC) {
ast_free((char *) e->summary);
@@ -3885,7 +3881,7 @@ int AST_OPTIONAL_API_NAME(ast_agi_register_multiple)(struct ast_module *mod, str
to fail is if the command is not
registered
*/
- (void) ast_agi_unregister(mod, cmd + x - 1);
+ (void) ast_agi_unregister(cmd + x - 1);
}
return -1;
}
@@ -3893,7 +3889,7 @@ int AST_OPTIONAL_API_NAME(ast_agi_register_multiple)(struct ast_module *mod, str
return 0;
}
-int AST_OPTIONAL_API_NAME(ast_agi_unregister_multiple)(struct ast_module *mod, struct agi_command *cmd, unsigned int len)
+int AST_OPTIONAL_API_NAME(ast_agi_unregister_multiple)(struct agi_command *cmd, unsigned int len)
{
unsigned int i;
int res = 0;
@@ -3903,7 +3899,7 @@ int AST_OPTIONAL_API_NAME(ast_agi_unregister_multiple)(struct ast_module *mod, s
attempts failed... there is no recourse if
any of them do
*/
- res |= ast_agi_unregister(mod, cmd + i);
+ res |= ast_agi_unregister(cmd + i);
}
return res;
@@ -4659,7 +4655,7 @@ AST_TEST_DEFINE(test_agi_null_docs)
}
#endif
- ast_agi_unregister(ast_module_info->self, &noop_command);
+ ast_agi_unregister(&noop_command);
return res;
}
#endif
@@ -4673,7 +4669,7 @@ static int unload_module(void)
STASIS_MESSAGE_TYPE_CLEANUP(agi_async_end_type);
ast_cli_unregister_multiple(cli_agi, ARRAY_LEN(cli_agi));
- ast_agi_unregister_multiple(ast_module_info->self, commands, ARRAY_LEN(commands));
+ ast_agi_unregister_multiple(commands, ARRAY_LEN(commands));
ast_unregister_application(eapp);
ast_unregister_application(deadapp);
ast_manager_unregister("AGI");
@@ -4706,9 +4702,6 @@ static int load_module(void)
return AST_MODULE_LOAD_DECLINE;
}
- /* For Optional API. */
- ast_module_shutdown_ref(AST_MODULE_SELF);
-
return AST_MODULE_LOAD_SUCCESS;
}