dovecot-2.0: pgsql: If host isn't given, don't show pgsql((null)...

dovecot at dovecot.org dovecot at dovecot.org
Fri Mar 4 19:33:54 EET 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/27ee65dc87c2
changeset: 12646:27ee65dc87c2
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Mar 04 19:33:52 2011 +0200
description:
pgsql: If host isn't given, don't show pgsql((null)) as log prefix (or crash).

diffstat:

 src/lib-sql/driver-pgsql.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r dfd5a2efd7df -r 27ee65dc87c2 src/lib-sql/driver-pgsql.c
--- a/src/lib-sql/driver-pgsql.c	Fri Mar 04 19:07:31 2011 +0200
+++ b/src/lib-sql/driver-pgsql.c	Fri Mar 04 19:33:52 2011 +0200
@@ -75,7 +75,8 @@
 
 static const char *pgsql_prefix(struct pgsql_db *db)
 {
-	return t_strdup_printf("pgsql(%s)", db->host);
+	return db->host == NULL ? "pgsql" :
+		t_strdup_printf("pgsql(%s)", db->host);
 }
 
 static void driver_pgsql_set_state(struct pgsql_db *db, enum sql_db_state state)


More information about the dovecot-cvs mailing list