[asterisk-commits] pabelanger: trunk r335719 - /trunk/main/dnsmgr.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 13 16:53:04 CDT 2011


Author: pabelanger
Date: Tue Sep 13 16:52:59 2011
New Revision: 335719

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=335719
Log:
Additional updates for parsing dnsmgr.conf

Review: https://reviewboard.asterisk.org/r/1432/

Modified:
    trunk/main/dnsmgr.c

Modified: trunk/main/dnsmgr.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/dnsmgr.c?view=diff&rev=335719&r1=335718&r2=335719
==============================================================================
--- trunk/main/dnsmgr.c (original)
+++ trunk/main/dnsmgr.c Tue Sep 13 16:52:59 2011
@@ -386,11 +386,9 @@
 	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 */
@@ -400,6 +398,11 @@
 	refresh_interval = REFRESH_DEFAULT;
 	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);
 
@@ -444,5 +447,5 @@
 	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;
+}




More information about the asterisk-commits mailing list