[svn-commits] russell: trunk r204419 - in /trunk: addons/ configs/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jun 30 12:10:48 CDT 2009


Author: russell
Date: Tue Jun 30 12:10:45 2009
New Revision: 204419

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=204419
Log:
Rename mysql.conf to app_mysql.conf, make module support both names

Added:
    trunk/configs/app_mysql.conf.sample
      - copied unchanged from r204416, trunk/configs/mysql.conf.sample
Removed:
    trunk/configs/mysql.conf.sample
Modified:
    trunk/addons/app_mysql.c

Modified: trunk/addons/app_mysql.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/addons/app_mysql.c?view=diff&rev=204419&r1=204418&r2=204419
==============================================================================
--- trunk/addons/app_mysql.c (original)
+++ trunk/addons/app_mysql.c Tue Jun 30 12:10:45 2009
@@ -92,7 +92,8 @@
 
 AST_MUTEX_DEFINE_STATIC(_mysql_mutex);
 
-#define MYSQL_CONFIG "mysql.conf"
+#define MYSQL_CONFIG "app_mysql.conf"
+#define MYSQL_CONFIG_OLD "mysql.conf"
 #define AST_MYSQL_ID_DUMMY   0
 #define AST_MYSQL_ID_CONNID  1
 #define AST_MYSQL_ID_RESID   2
@@ -586,6 +587,11 @@
 	struct ast_config *cfg = ast_config_load(MYSQL_CONFIG, config_flags);
 	const char *temp;
 
+	if (!cfg) {
+		/* Backwards compatibility ftw */
+		cfg = ast_config_load(MYSQL_CONFIG_OLD, config_flags);
+	}
+
 	if (cfg) {
 		if ((temp = ast_variable_retrieve(cfg, "general", "nullvalue"))) {
 			if (!strcasecmp(temp, "nullstring")) {




More information about the svn-commits mailing list