mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-25 15:08:53 +00:00
Formating changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@288992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -341,18 +341,24 @@ static int unload_module(void)
|
|||||||
|
|
||||||
PQfinish(conn);
|
PQfinish(conn);
|
||||||
|
|
||||||
if (pghostname)
|
if (pghostname) {
|
||||||
ast_free(pghostname);
|
ast_free(pghostname);
|
||||||
if (pgdbname)
|
}
|
||||||
|
if (pgdbname) {
|
||||||
ast_free(pgdbname);
|
ast_free(pgdbname);
|
||||||
if (pgdbuser)
|
}
|
||||||
|
if (pgdbuser) {
|
||||||
ast_free(pgdbuser);
|
ast_free(pgdbuser);
|
||||||
if (pgpassword)
|
}
|
||||||
|
if (pgpassword) {
|
||||||
ast_free(pgpassword);
|
ast_free(pgpassword);
|
||||||
if (pgdbport)
|
}
|
||||||
|
if (pgdbport) {
|
||||||
ast_free(pgdbport);
|
ast_free(pgdbport);
|
||||||
if (table)
|
}
|
||||||
|
if (table) {
|
||||||
ast_free(table);
|
ast_free(table);
|
||||||
|
}
|
||||||
|
|
||||||
AST_RWLIST_WRLOCK(&psql_columns);
|
AST_RWLIST_WRLOCK(&psql_columns);
|
||||||
while ((current = AST_RWLIST_REMOVE_HEAD(&psql_columns, list))) {
|
while ((current = AST_RWLIST_REMOVE_HEAD(&psql_columns, list))) {
|
||||||
@@ -376,8 +382,9 @@ static int config_module(int reload)
|
|||||||
if ((cfg = ast_config_load(config, config_flags)) == NULL || cfg == CONFIG_STATUS_FILEINVALID) {
|
if ((cfg = ast_config_load(config, config_flags)) == NULL || cfg == CONFIG_STATUS_FILEINVALID) {
|
||||||
ast_log(LOG_WARNING, "Unable to load config for PostgreSQL CDR's: %s\n", config);
|
ast_log(LOG_WARNING, "Unable to load config for PostgreSQL CDR's: %s\n", config);
|
||||||
return -1;
|
return -1;
|
||||||
} else if (cfg == CONFIG_STATUS_FILEUNCHANGED)
|
} else if (cfg == CONFIG_STATUS_FILEUNCHANGED) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(var = ast_variable_browse(cfg, "global"))) {
|
if (!(var = ast_variable_browse(cfg, "global"))) {
|
||||||
ast_config_destroy(cfg);
|
ast_config_destroy(cfg);
|
||||||
@@ -389,8 +396,9 @@ static int config_module(int reload)
|
|||||||
tmp = ""; /* connect via UNIX-socket by default */
|
tmp = ""; /* connect via UNIX-socket by default */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pghostname)
|
if (pghostname) {
|
||||||
ast_free(pghostname);
|
ast_free(pghostname);
|
||||||
|
}
|
||||||
if (!(pghostname = ast_strdup(tmp))) {
|
if (!(pghostname = ast_strdup(tmp))) {
|
||||||
ast_config_destroy(cfg);
|
ast_config_destroy(cfg);
|
||||||
return -1;
|
return -1;
|
||||||
@@ -401,8 +409,9 @@ static int config_module(int reload)
|
|||||||
tmp = "asteriskcdrdb";
|
tmp = "asteriskcdrdb";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pgdbname)
|
if (pgdbname) {
|
||||||
ast_free(pgdbname);
|
ast_free(pgdbname);
|
||||||
|
}
|
||||||
if (!(pgdbname = ast_strdup(tmp))) {
|
if (!(pgdbname = ast_strdup(tmp))) {
|
||||||
ast_config_destroy(cfg);
|
ast_config_destroy(cfg);
|
||||||
return -1;
|
return -1;
|
||||||
@@ -413,8 +422,9 @@ static int config_module(int reload)
|
|||||||
tmp = "asterisk";
|
tmp = "asterisk";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pgdbuser)
|
if (pgdbuser) {
|
||||||
ast_free(pgdbuser);
|
ast_free(pgdbuser);
|
||||||
|
}
|
||||||
if (!(pgdbuser = ast_strdup(tmp))) {
|
if (!(pgdbuser = ast_strdup(tmp))) {
|
||||||
ast_config_destroy(cfg);
|
ast_config_destroy(cfg);
|
||||||
return -1;
|
return -1;
|
||||||
@@ -425,8 +435,9 @@ static int config_module(int reload)
|
|||||||
tmp = "";
|
tmp = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pgpassword)
|
if (pgpassword) {
|
||||||
ast_free(pgpassword);
|
ast_free(pgpassword);
|
||||||
|
}
|
||||||
if (!(pgpassword = ast_strdup(tmp))) {
|
if (!(pgpassword = ast_strdup(tmp))) {
|
||||||
ast_config_destroy(cfg);
|
ast_config_destroy(cfg);
|
||||||
return -1;
|
return -1;
|
||||||
@@ -437,8 +448,9 @@ static int config_module(int reload)
|
|||||||
tmp = "5432";
|
tmp = "5432";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pgdbport)
|
if (pgdbport) {
|
||||||
ast_free(pgdbport);
|
ast_free(pgdbport);
|
||||||
|
}
|
||||||
if (!(pgdbport = ast_strdup(tmp))) {
|
if (!(pgdbport = ast_strdup(tmp))) {
|
||||||
ast_config_destroy(cfg);
|
ast_config_destroy(cfg);
|
||||||
return -1;
|
return -1;
|
||||||
@@ -449,8 +461,9 @@ static int config_module(int reload)
|
|||||||
tmp = "cdr";
|
tmp = "cdr";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (table)
|
if (table) {
|
||||||
ast_free(table);
|
ast_free(table);
|
||||||
|
}
|
||||||
if (!(table = ast_strdup(tmp))) {
|
if (!(table = ast_strdup(tmp))) {
|
||||||
ast_config_destroy(cfg);
|
ast_config_destroy(cfg);
|
||||||
return -1;
|
return -1;
|
||||||
|
Reference in New Issue
Block a user