[svn-commits] qwell: trunk r90410 - /trunk/res/res_adsi.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Nov 30 19:37:51 CST 2007


Author: qwell
Date: Fri Nov 30 19:37:50 2007
New Revision: 90410

URL: http://svn.digium.com/view/asterisk?view=rev&rev=90410
Log:
Only reload if the config file has changed.

Closes issue #11281, patch by eliel.

Modified:
    trunk/res/res_adsi.c

Modified: trunk/res/res_adsi.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_adsi.c?view=diff&rev=90410&r1=90409&r2=90410
==============================================================================
--- trunk/res/res_adsi.c (original)
+++ trunk/res/res_adsi.c Fri Nov 30 19:37:50 2007
@@ -1012,18 +1012,19 @@
 	alignment = ADSI_JUST_CENT;
 }
 
-static void adsi_load(void)
+static void adsi_load(int reload)
 {
 	int x = 0;
 	struct ast_config *conf = NULL;
 	struct ast_variable *v;
-	struct ast_flags config_flags = { 0 };
+	struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
 	char *name, *sname;
 	init_state();
 
 	if (!(conf = ast_config_load("adsi.conf", config_flags)))
 		return;
-	
+	else if (conf == CONFIG_STATUS_FILEUNCHANGED)
+		return;
 	for (v = ast_variable_browse(conf, "intro"); v; v = v->next) {
 		if (!strcasecmp(v->name, "alignment"))
 			alignment = str2align(v->value);
@@ -1066,13 +1067,13 @@
 
 static int reload(void)
 {
-	adsi_load();
+	adsi_load(1);
 	return 0;
 }
 
 static int load_module(void)
 {
-	adsi_load();
+	adsi_load(0);
 
 	ast_adsi_begin_download = _ast_adsi_begin_download;
 	ast_adsi_end_download = _ast_adsi_end_download;




More information about the svn-commits mailing list