summaryrefslogtreecommitdiff
path: root/res/res_musiconhold.c
diff options
context:
space:
mode:
authorSean Bright <sean.bright@gmail.com>2016-01-13 08:20:24 -0500
committerSean Bright <sean.bright@gmail.com>2016-01-13 07:50:19 -0600
commite7cfda0b384897c6f52db0c7d7b126f5158461cb (patch)
tree050827b9d57538079fd5b839a58503ec4ab68641 /res/res_musiconhold.c
parent092c0db4936d6418fbd1b2e9e1d9a8d34d7e1c8e (diff)
res_musiconhold: Prevent multiple simultaneous reloads.
There are two ways in which the reload() function in res_musiconhold can be called from the CLI: * module reload res_musiconhold.so * moh reload In the former case, the module loader holds a lock that prevents multiple concurrent calls, but in the latter there is no such protection. This patch changes the 'moh reload' CLI command to invoke the module loader directly, rather than call reload() explicitly. ASTERISK-25687 #close Change-Id: I408968b4c8932864411b7f9ad88cfdc7b9ba711c
Diffstat (limited to 'res/res_musiconhold.c')
-rw-r--r--res/res_musiconhold.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index 2ac5081b9..669fb9bc9 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -1821,7 +1821,8 @@ static char *handle_cli_moh_reload(struct ast_cli_entry *e, int cmd, struct ast_
if (a->argc != e->args)
return CLI_SHOWUSAGE;
- reload();
+ /* The module loader will prevent concurrent reloads from occurring, so we delegate */
+ ast_module_reload("res_musiconhold");
return CLI_SUCCESS;
}