Don't reconnect db on reload unless there was a failure

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1741 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2003-11-13 16:25:52 +00:00
parent fe98390fe0
commit 9d244cb4ce
2 changed files with 2 additions and 2 deletions

View File

@@ -4932,7 +4932,7 @@ static int set_config(char *config_file, struct sockaddr_in* sin){
ast_destroy(cfg);
#ifdef MYSQL_FRIENDS
/* Connect to db if appropriate */
if (strlen(mydbname)) {
if (!mysql && strlen(mydbname)) {
mysql = mysql_init(NULL);
if (!mysql_real_connect(mysql, mydbhost[0] ? mydbhost : NULL, mydbuser, mydbpass, mydbname, 0, NULL, 0)) {
memset(mydbpass, '*', strlen(mydbpass));

View File

@@ -5516,7 +5516,7 @@ static int set_config(char *config_file, struct sockaddr_in* sin){
set_timing();
#ifdef MYSQL_FRIENDS
/* Connect to db if appropriate */
if (strlen(mydbname)) {
if (!mysql && strlen(mydbname)) {
mysql = mysql_init(NULL);
if (!mysql_real_connect(mysql, mydbhost[0] ? mydbhost : NULL, mydbuser, mydbpass, mydbname, 0, NULL, 0)) {
memset(mydbpass, '*', strlen(mydbpass));