]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Make error hint from bind() failure more accurate
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 25 Nov 2020 07:14:23 +0000 (08:14 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 25 Nov 2020 07:33:57 +0000 (08:33 +0100)
commitd5d91acdccae6b322a5634be2c66d62fc6b9a43d
treef039b9f6c20890672585f87dfc2fd4921c0c5a67
parentc9f0624bc2f544baacafa38e3797d5323401d039
Make error hint from bind() failure more accurate

The hint "Is another postmaster already running ..." should only be
printed for errors that are really about something else already using
the address.  In other cases it is misleading.  So only show that hint
if errno == EADDRINUSE.

Also, since Unix-domain sockets in the file-system namespace never
report EADDRINUSE for an existing file (they would just overwrite it),
the part of the hint saying "If not, remove socket file \"%s\" and
retry." can never happen, so remove it.  Unix-domain sockets in the
abstract namespace can report EADDRINUSE, but in that case there is no
file to remove, so the hint doesn't work there either.

Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://www.postgresql.org/message-id/flat/6dee8574-b0ad-fc49-9c8c-2edc796f0033@2ndquadrant.com
src/backend/libpq/pqcomm.c