From: Sebastian Harl Date: Wed, 23 Jul 2008 12:29:56 +0000 (+0200) Subject: postgresql plugin: Fixed the expansion of the "hostname" parameter. X-Git-Tag: collectd-4.5.0~84 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=883531cd6271cb8e47adf24973893062db0d3d43;p=collectd.git 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 --- 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;