summaryrefslogtreecommitdiff
path: root/res/res_config_pgsql.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2010-05-26 16:14:48 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2010-05-26 16:14:48 +0000
commit5c9fdd8666834fd046736db6e878b533d600efea (patch)
treeddd69b29d1d3295bbe5676b8df5d5e30591726b5 /res/res_config_pgsql.c
parent822423adb8b10509bed3a98b047415e696bcb833 (diff)
Construct socket name, according to the Postgres docs, and document as such.
(closes issue #17392) Reported by: dps Patches: 20100525__issue17392.diff.txt uploaded by tilghman (license 14) Tested by: dps git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@265894 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_config_pgsql.c')
-rw-r--r--res/res_config_pgsql.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/res/res_config_pgsql.c b/res/res_config_pgsql.c
index e4bffd307..9a6650fa4 100644
--- a/res/res_config_pgsql.c
+++ b/res/res_config_pgsql.c
@@ -1391,8 +1391,8 @@ static int parse_config(int is_reload)
/* No socket needed */
} else if (!(s = ast_variable_retrieve(config, "general", "dbsock"))) {
ast_log(LOG_WARNING,
- "PostgreSQL RealTime: No database socket found, using '/tmp/pgsql.sock' as default.\n");
- strcpy(dbsock, "/tmp/pgsql.sock");
+ "PostgreSQL RealTime: No database socket found, using '/tmp/.s.PGSQL.%d' as default.\n", dbport);
+ strcpy(dbsock, "/tmp");
} else {
ast_copy_string(dbsock, s, sizeof(dbsock));
}
@@ -1453,7 +1453,7 @@ static int pgsql_reconnect(const char *database)
struct ast_str *connInfo = ast_str_create(32);
ast_str_set(&connInfo, 0, "host=%s port=%d dbname=%s user=%s",
- dbhost, dbport, my_database, dbuser);
+ S_OR(dbhost, dbsock), dbport, my_database, dbuser);
if (!ast_strlen_zero(dbpass))
ast_str_append(&connInfo, 0, " password=%s", dbpass);