aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/postmaster/postmaster.c7
-rw-r--r--src/backend/tcop/postgres.c10
2 files changed, 10 insertions, 7 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 313ef2af31a..aee26add558 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.467 2005/08/20 23:26:17 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.468 2005/09/22 15:33:35 momjian Exp $
*
* NOTES
*
@@ -2701,8 +2701,9 @@ BackendRun(Port *port)
if (Log_connections)
ereport(LOG,
- (errmsg("connection received: host=%s port=%s",
- remote_host, remote_port)));
+ (errmsg("connection received: host=%s%s%s",
+ remote_host, remote_port[0] ? " port=" : "",
+ remote_port)));
/*
* save remote_host and remote_port in port stucture
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 7967bef1292..22f47a9d6ba 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.460 2005/09/19 17:21:47 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.461 2005/09/22 15:33:36 momjian Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -3525,9 +3525,11 @@ log_disconnections(int code, Datum arg)
snprintf(dbname, sizeof(dbname), " database=%s", port->database_name);
snprintf(remote_host, sizeof(remote_host), " host=%s",
port->remote_host);
- snprintf(remote_port, sizeof(remote_port), " port=%s", port->remote_port);
-
-
+ if (port->remote_port[0])
+ snprintf(remote_port, sizeof(remote_port), " port=%s", port->remote_port);
+ else
+ remote_port[0] = '\0';
+
gettimeofday(&end, NULL);
if (end.tv_usec < port->session_start.tv_usec)