]> granicus.if.org Git - postgresql/commitdiff
Include port number when logging successful binding to a TCP port.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 14 Mar 2017 17:18:27 +0000 (13:18 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 14 Mar 2017 17:18:38 +0000 (13:18 -0400)
Per suggestion from Andres Freund.

Discussion: https://postgr.es/m/20170314033842.st7gifec55yigz2h@alap3.anarazel.de

src/backend/libpq/pqcomm.c

index aa934569da33d1eccd36986dc4d55d7d8551dcb3..0fad8060b17bff28b566fe65929f75b73a445867 100644 (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++;