From d806ae0da0811f26d23fd241ede8840d09cf74e4 Mon Sep 17 00:00:00 2001
From: Russell Bryant <russell@russellbryant.com>
Date: Tue, 30 Jun 2009 17:15:09 +0000
Subject: [PATCH] Rename res_mysql.conf to res_config_mysql.conf, make module
 support both

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@204422 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 addons/res_config_mysql.c                                 | 8 +++++++-
 ...res_mysql.conf.sample => res_config_mysql.conf.sample} | 0
 2 files changed, 7 insertions(+), 1 deletion(-)
 rename configs/{res_mysql.conf.sample => res_config_mysql.conf.sample} (100%)

diff --git a/addons/res_config_mysql.c b/addons/res_config_mysql.c
index 2cd1fa4f46..76a741695b 100644
--- a/addons/res_config_mysql.c
+++ b/addons/res_config_mysql.c
@@ -47,7 +47,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/utils.h"
 #include "asterisk/threadstorage.h"
 
-#define RES_CONFIG_MYSQL_CONF "res_mysql.conf"
+#define RES_CONFIG_MYSQL_CONF "res_config_mysql.conf"
+#define RES_CONFIG_MYSQL_CONF_OLD "res_mysql.conf"
 #define	READHANDLE	0
 #define	WRITEHANDLE	1
 
@@ -1413,6 +1414,11 @@ static int parse_config(int reload)
 	struct mysql_conn *cur;
 
 	if ((config = ast_config_load(RES_CONFIG_MYSQL_CONF, config_flags)) == CONFIG_STATUS_FILEMISSING) {
+		/* Support old config file name */
+		config = ast_config_load(RES_CONFIG_MYSQL_CONF_OLD, config_flags);
+	}
+
+	if (config == CONFIG_STATUS_FILEMISSING) {
 		return 0;
 	} else if (config == CONFIG_STATUS_FILEUNCHANGED) {
 		return 0;
diff --git a/configs/res_mysql.conf.sample b/configs/res_config_mysql.conf.sample
similarity index 100%
rename from configs/res_mysql.conf.sample
rename to configs/res_config_mysql.conf.sample
-- 
GitLab