summaryrefslogtreecommitdiff
path: root/main/loader.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2012-08-16 22:45:33 +0000
committerKinsey Moore <kmoore@digium.com>2012-08-16 22:45:33 +0000
commit34265d52654ddb2171a10a1b67bdfa4eb10906e1 (patch)
treefb28675536a68e117a7709be2655c23c8dfeafcc /main/loader.c
parentd4879edd8e8ed09b62c22a0def5ffe277b27af49 (diff)
Add module reload instrumentation for TEST_FRAMEWORK
This adds AMI events for module reloads when Asterisk is built with TEST_FRAMEWORK enabled and corrects generation of the module load AMI event. (issue PQ-1126) ........ Merged revisions 371393 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 371394 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 371395 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371396 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/loader.c')
-rw-r--r--main/loader.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/main/loader.c b/main/loader.c
index d82408349..1da6ef2fa 100644
--- a/main/loader.c
+++ b/main/loader.c
@@ -750,6 +750,8 @@ int ast_module_reload(const char *name)
}
if (!info->reload) { /* cannot be reloaded */
+ /* Nothing to reload, so reload is successful */
+ ast_test_suite_event_notify("MODULE_RELOAD", "Message: %s", cur->resource);
if (res < 1) /* store result if possible */
res = 1; /* 1 = no reload() method */
continue;
@@ -757,7 +759,9 @@ int ast_module_reload(const char *name)
res = 2;
ast_verb(3, "Reloading module '%s' (%s)\n", cur->resource, info->description);
- info->reload();
+ if (!info->reload()) {
+ ast_test_suite_event_notify("MODULE_RELOAD", "Message: %s", cur->resource);
+ }
}
AST_LIST_UNLOCK(&module_list);
@@ -910,7 +914,9 @@ int ast_load_resource(const char *resource_name)
int res;
AST_LIST_LOCK(&module_list);
res = load_resource(resource_name, 0, NULL, 0);
- ast_test_suite_event_notify("MODULE_LOAD", "Message: %s", resource_name);
+ if (!res) {
+ ast_test_suite_event_notify("MODULE_LOAD", "Message: %s", resource_name);
+ }
AST_LIST_UNLOCK(&module_list);
return res;