aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 8654c11ad8b..729f9a00039 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.51 1997/11/02 15:25:45 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.52 1997/11/07 20:51:54 momjian Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -832,7 +832,6 @@ PostgresMain(int argc, char *argv[])
bool multiplexedBackend;
char *hostName; /* the host name of the backend server */
- char hostbuf[MAXHOSTNAMELEN];
int serverSock;
int serverPortnum = 0;
int nSelected; /* number of descriptors ready from
@@ -884,15 +883,10 @@ PostgresMain(int argc, char *argv[])
#endif
/*
- * get hostname is either the environment variable PGHOST or
- * 'localhost'
+ * get hostname is either the environment variable PGHOST or NULL
+ * NULL means Unix-socket only
*/
- if (!(hostName = getenv("PGHOST")))
- {
- if (gethostname(hostbuf, MAXHOSTNAMELEN) < 0)
- strcpy(hostbuf, "localhost");
- hostName = hostbuf;
- }
+ hostName = getenv("PGHOST");
DataDir = getenv("PGDATA"); /* default */
multiplexedBackend = false; /* default */
@@ -1252,7 +1246,7 @@ PostgresMain(int argc, char *argv[])
if (multiplexedBackend)
{
if (serverPortnum == 0 ||
- StreamServerPort(hostName, serverPortnum, &serverSock) != STATUS_OK)
+ StreamServerPort(hostName, serverPortnum, &serverSock) != STATUS_OK)
{
fprintf(stderr, "Postgres: cannot create stream port %d\n", serverPortnum);
exit(1);
@@ -1343,7 +1337,7 @@ PostgresMain(int argc, char *argv[])
if (IsUnderPostmaster == false)
{
puts("\nPOSTGRES backend interactive interface");
- puts("$Revision: 1.51 $ $Date: 1997/11/02 15:25:45 $");
+ puts("$Revision: 1.52 $ $Date: 1997/11/07 20:51:54 $");
}
/* ----------------