Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4032a51

Browse files
committed
PGPORT envar was erroneously ignored by the backend
1 parentbeb7f7f commit4032a51

File tree

3 files changed

+7
-21
lines changed

3 files changed

+7
-21
lines changed

‎src/backend/libpq/pqcomm.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
3030
* Portions Copyright (c) 1994, Regents of the University of California
3131
*
32-
*$Id: pqcomm.c,v 1.95 2000/06/04 01:44:30 petere Exp $
32+
*$Id: pqcomm.c,v 1.96 2000/06/06 16:04:29 petere Exp $
3333
*
3434
*-------------------------------------------------------------------------
3535
*/
@@ -118,19 +118,6 @@ pq_init(void)
118118
debug_port=stderr;
119119
}
120120

121-
/* --------------------------------
122-
*pq_getport - return the PGPORT setting
123-
* --------------------------------
124-
*/
125-
int
126-
pq_getport(void)
127-
{
128-
char*envport=getenv("PGPORT");
129-
130-
if (envport)
131-
returnatoi(envport);
132-
returnDEF_PGPORT;
133-
}
134121

135122
/* --------------------------------
136123
*pq_close - shutdown libpq at backend exit

‎src/backend/postmaster/postmaster.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.146 2000/06/04 01:44:31 petere Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.147 2000/06/06 16:04:29 petere Exp $
1515
*
1616
* NOTES
1717
*
@@ -129,7 +129,7 @@ static Dllist *BackendList;
129129
/* list of ports associated with still open, but incomplete connections */
130130
staticDllist*PortList;
131131

132-
intPostPortName=DEF_PGPORT;
132+
intPostPortName;
133133

134134
/*
135135
* This is a boolean indicating that there is at least one backend that
@@ -381,6 +381,9 @@ PostmasterMain(int argc, char *argv[])
381381
MyProcPid=getpid();
382382
DataDir=getenv("PGDATA");/* default value */
383383

384+
if (getenv("PGPORT"))
385+
PostPortName=atoi(getenv("PGPORT"));
386+
384387
/*
385388
* First we must scan for a -D argument to get the data dir. Then
386389
* read the config file. Finally, scan all the other arguments.
@@ -543,9 +546,6 @@ PostmasterMain(int argc, char *argv[])
543546
}
544547
}
545548

546-
if (PostPortName==0)
547-
PostPortName=pq_getport();
548-
549549
/*
550550
* Check for invalid combinations of switches
551551
*/

‎src/include/libpq/libpq.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: libpq.h,v 1.37 2000/06/04 01:44:37 petere Exp $
10+
* $Id: libpq.h,v 1.38 2000/06/06 16:04:32 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -240,7 +240,6 @@ extern intStreamServerPort(int family, unsigned short portName, int *fdP);
240240
externintStreamConnection(intserver_fd,Port*port);
241241
externvoidStreamClose(intsock);
242242
externvoidpq_init(void);
243-
externintpq_getport(void);
244243
externvoidpq_close(void);
245244
externintpq_getbytes(char*s,size_tlen);
246245
externintpq_getstring(StringInfos);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp