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
This commit is contained in:
Tom Lane 2017-03-14 13:18:27 -04:00
parent 100871c2d1
commit 2b32ac2a59
1 changed files with 11 additions and 4 deletions

View File

@ -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++;