diff options
author | Paul Belanger <paul.belanger@polybeacon.com> | 2011-09-13 21:52:59 +0000 |
---|---|---|
committer | Paul Belanger <paul.belanger@polybeacon.com> | 2011-09-13 21:52:59 +0000 |
commit | 7a7f048d9750eeed7eb248f437fe88e89ee4f7ae (patch) | |
tree | da6e0fd59a9806a6bc338d024c3efbc530fa2710 /main/dnsmgr.c | |
parent | 57a8b5a781bb3b68f7e538e062ba10ab9c51421a (diff) |
Additional updates for parsing dnsmgr.conf
Review: https://reviewboard.asterisk.org/r/1432/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@335719 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/dnsmgr.c')
-rw-r--r-- | main/dnsmgr.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/main/dnsmgr.c b/main/dnsmgr.c index a62c37185..bd3ab78e3 100644 --- a/main/dnsmgr.c +++ b/main/dnsmgr.c @@ -386,11 +386,9 @@ static int do_reload(int loading) struct ast_flags config_flags = { loading ? 0 : CONFIG_FLAG_FILEUNCHANGED }; int interval; int was_enabled; - int res = 0; - config = ast_config_load2("dnsmgr.conf", "dnsmgr", config_flags); - if (config == CONFIG_STATUS_FILEMISSING || config == CONFIG_STATUS_FILEUNCHANGED || config == CONFIG_STATUS_FILEINVALID) { - return res; + if ((config = ast_config_load2("dnsmgr.conf", "dnsmgr", config_flags)) == CONFIG_STATUS_FILEUNCHANGED) { + return 0; } /* ensure that no refresh cycles run while the reload is in progress */ @@ -401,6 +399,11 @@ static int do_reload(int loading) was_enabled = enabled; enabled = 0; + if (config == CONFIG_STATUS_FILEMISSING || config == CONFIG_STATUS_FILEINVALID) { + ast_mutex_unlock(&refresh_lock); + return 0; + } + AST_SCHED_DEL(sched, refresh_sched); for (v = ast_variable_browse(config, "general"); v; v = v->next) { @@ -444,5 +447,5 @@ static int do_reload(int loading) ast_mutex_unlock(&refresh_lock); manager_event(EVENT_FLAG_SYSTEM, "Reload", "Module: DNSmgr\r\nStatus: %s\r/nMessage: DNSmgr reload Requested\r\n", enabled ? "Enabled" : "Disabled"); - return res; + return 0; } |