From 883531cd6271cb8e47adf24973893062db0d3d43 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Wed, 23 Jul 2008 14:29:56 +0200 Subject: [PATCH] postgresql plugin: Fixed the expansion of the "hostname" parameter. If the configured hostname specifies a UNIX domain socket, the parameter now expands to "localhost" as described earlier. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- src/postgresql.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/postgresql.c b/src/postgresql.c index d65a66fd..f2d7665f 100644 --- a/src/postgresql.c +++ b/src/postgresql.c @@ -345,7 +345,8 @@ static int c_psql_exec_query (c_psql_database_t *db, int idx) for (i = 0; i < query->params_num; ++i) { switch (query->params[i]) { case C_PSQL_PARAM_HOST: - params[i] = (NULL == db->host) ? "localhost" : db->host; + params[i] = C_PSQL_IS_UNIX_DOMAIN_SOCKET (db->host) + ? "localhost" : db->host; break; case C_PSQL_PARAM_DB: params[i] = db->database; -- 2.30.2