remove an unused variable, and default the user to asterisk if not specified

in the config file (issue #7153, Mithraen)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@28936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2006-05-20 01:35:12 +00:00
parent f1a97c3b3f
commit d8f4a04acc

View File

@@ -63,7 +63,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static char *desc = "PostgreSQL CDR Backend"; static char *desc = "PostgreSQL CDR Backend";
static char *name = "pgsql"; static char *name = "pgsql";
static char *config = "cdr_pgsql.conf"; static char *config = "cdr_pgsql.conf";
static char *pghostname = NULL, *pgdbname = NULL, *pgdbuser = NULL, *pgpassword = NULL, *pgdbsock = NULL, *pgdbport = NULL, *table = NULL; static char *pghostname = NULL, *pgdbname = NULL, *pgdbuser = NULL, *pgpassword = NULL, *pgdbport = NULL, *table = NULL;
static int connected = 0; static int connected = 0;
AST_MUTEX_DEFINE_STATIC(pgsql_lock); AST_MUTEX_DEFINE_STATIC(pgsql_lock);
@@ -195,8 +195,6 @@ static int my_unload_module(void)
free(pgdbname); free(pgdbname);
if (pgdbuser) if (pgdbuser)
free(pgdbuser); free(pgdbuser);
if (pgdbsock)
free(pgdbsock);
if (pgpassword) if (pgpassword)
free(pgpassword); free(pgpassword);
if (pgdbport) if (pgdbport)
@@ -233,8 +231,8 @@ static int process_my_load_module(struct ast_config *cfg)
return -1; return -1;
if (!(tmp = ast_variable_retrieve(cfg, "global", "user"))) { if (!(tmp = ast_variable_retrieve(cfg, "global", "user"))) {
ast_log(LOG_WARNING,"PostgreSQL database user not specified. Assuming root\n"); ast_log(LOG_WARNING,"PostgreSQL database user not specified. Assuming asterisk\n");
tmp = "root"; tmp = "asterisk";
} }
if (!(pgdbuser = ast_strdup(tmp))) if (!(pgdbuser = ast_strdup(tmp)))