[Asterisk-code-review] loader: Fix result of module reload error. (asterisk[16])
George Joseph
asteriskteam at digium.com
Wed Oct 3 10:19:41 CDT 2018
George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/10353 )
Change subject: loader: Fix result of module reload error.
......................................................................
loader: Fix result of module reload error.
When a module reload fails we never set AST_MODULE_RELOAD_ERROR. This
caused reload failures to incorrectly report 'No module found'.
Change-Id: I5f3953e0f7d135e53ec797f24c97ee3f73f232e7
---
M main/loader.c
1 file changed, 7 insertions(+), 5 deletions(-)
Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved; Approved for Submit
diff --git a/main/loader.c b/main/loader.c
index eb345b5..ce73d96 100644
--- a/main/loader.c
+++ b/main/loader.c
@@ -1350,14 +1350,14 @@
if (ast_opt_lock_confdir) {
int try;
- int res;
- for (try = 1, res = AST_LOCK_TIMEOUT; try < 6 && (res == AST_LOCK_TIMEOUT); try++) {
- res = ast_lock_path(ast_config_AST_CONFIG_DIR);
- if (res == AST_LOCK_TIMEOUT) {
+ int lockres;
+ for (try = 1, lockres = AST_LOCK_TIMEOUT; try < 6 && (lockres == AST_LOCK_TIMEOUT); try++) {
+ lockres = ast_lock_path(ast_config_AST_CONFIG_DIR);
+ if (lockres == AST_LOCK_TIMEOUT) {
ast_log(LOG_WARNING, "Failed to grab lock on %s, try %d\n", ast_config_AST_CONFIG_DIR, try);
}
}
- if (res != AST_LOCK_SUCCESS) {
+ if (lockres != AST_LOCK_SUCCESS) {
ast_log(AST_LOG_WARNING, "Cannot grab lock on %s\n", ast_config_AST_CONFIG_DIR);
res = AST_MODULE_RELOAD_ERROR;
goto module_reload_done;
@@ -1394,6 +1394,8 @@
ast_verb(3, "Reloading module '%s' (%s)\n", cur->resource, info->description);
if (info->reload() == AST_MODULE_LOAD_SUCCESS) {
res = AST_MODULE_RELOAD_SUCCESS;
+ } else if (res == AST_MODULE_RELOAD_NOT_FOUND) {
+ res = AST_MODULE_RELOAD_ERROR;
}
if (name) {
break;
--
To view, visit https://gerrit.asterisk.org/10353
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-MessageType: merged
Gerrit-Change-Id: I5f3953e0f7d135e53ec797f24c97ee3f73f232e7
Gerrit-Change-Number: 10353
Gerrit-PatchSet: 2
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181003/105e90de/attachment.html>
More information about the asterisk-code-review
mailing list