From 2b32ac2a59df18246c3b79e96a209bfdb39bb918 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 14 Mar 2017 13:18:27 -0400 Subject: [PATCH] Include port number when logging successful binding to a TCP port. Per suggestion from Andres Freund. Discussion: https://postgr.es/m/20170314033842.st7gifec55yigz2h@alap3.anarazel.de --- src/backend/libpq/pqcomm.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c index aa934569da..0fad8060b1 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -561,10 +561,17 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber, continue; } - ereport(LOG, - /* translator: first %s is IPv4, IPv6, or Unix */ - (errmsg("listening on %s address \"%s\"", - familyDesc, addrDesc))); +#ifdef HAVE_UNIX_SOCKETS + if (addr->ai_family == AF_UNIX) + ereport(LOG, + (errmsg("listening on Unix socket \"%s\"", + addrDesc))); + else +#endif + ereport(LOG, + /* translator: first %s is IPv4 or IPv6 */ + (errmsg("listening on %s address \"%s\", port %d", + familyDesc, addrDesc, (int) portNumber))); ListenSocket[listen_index] = fd; added++; -- 2.40.0