Commit 7a30b1fb authored by Peter Eisentraut's avatar Peter Eisentraut

Issue fatal error if no TCP/IP sockets could be created

parent 117fde2d
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.456 2005/06/29 22:51:55 tgl Exp $ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.457 2005/06/30 10:02:22 petere Exp $
* *
* NOTES * NOTES
* *
...@@ -711,6 +711,7 @@ PostmasterMain(int argc, char *argv[]) ...@@ -711,6 +711,7 @@ PostmasterMain(int argc, char *argv[])
char *rawstring; char *rawstring;
List *elemlist; List *elemlist;
ListCell *l; ListCell *l;
int success = 0;
/* Need a modifiable copy of ListenAddresses */ /* Need a modifiable copy of ListenAddresses */
rawstring = pstrdup(ListenAddresses); rawstring = pstrdup(ListenAddresses);
...@@ -738,12 +739,18 @@ PostmasterMain(int argc, char *argv[]) ...@@ -738,12 +739,18 @@ PostmasterMain(int argc, char *argv[])
(unsigned short) PostPortNumber, (unsigned short) PostPortNumber,
UnixSocketDir, UnixSocketDir,
ListenSocket, MAXLISTEN); ListenSocket, MAXLISTEN);
if (status != STATUS_OK) if (status == STATUS_OK)
success++;
else
ereport(WARNING, ereport(WARNING,
(errmsg("could not create listen socket for \"%s\"", (errmsg("could not create listen socket for \"%s\"",
curhost))); curhost)));
} }
if (!success && list_length(elemlist))
ereport(FATAL,
(errmsg("could not create any TCP/IP sockets")));
list_free(elemlist); list_free(elemlist);
pfree(rawstring); pfree(rawstring);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment