diff --git a/main/loader.c b/main/loader.c index d824083496775148bf09215508208cd5e3d6fd5e..1da6ef2fa5886fb69aa9eb1f3c0d127a25be318b 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;