Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 026643a

Browse files
committed
Rename PortName to PortNumber.
1 parent ab47254 commit 026643a

File tree

6 files changed

+19
-33
lines changed

6 files changed

+19
-33
lines changed

src/backend/libpq/pqcomm.c

Lines changed: 4 additions & 4 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.111 2000/11/13 21:31:46 momjian Exp $
32+
* $Id: pqcomm.c,v 1.112 2000/11/14 01:15:00 momjian Exp $
3333
*
3434
*-------------------------------------------------------------------------
3535
*/
@@ -175,7 +175,7 @@ StreamDoUnlink(void)
175175
*/
176176

177177
int
178-
StreamServerPort(int family, char *hostName, unsigned short portName,
178+
StreamServerPort(int family, char *hostName, unsigned short portNumber,
179179
char *unixSocketName, int *fdP)
180180
{
181181
SockAddr saddr;
@@ -219,7 +219,7 @@ StreamServerPort(int family, char *hostName, unsigned short portName,
219219
#ifdef HAVE_UNIX_SOCKETS
220220
if (family == AF_UNIX)
221221
{
222-
UNIXSOCK_PATH(saddr.un, portName, unixSocketName);
222+
UNIXSOCK_PATH(saddr.un, portNumber, unixSocketName);
223223
len = UNIXSOCK_LEN(saddr.un);
224224
strcpy(sock_path, saddr.un.sun_path);
225225
/*
@@ -265,7 +265,7 @@ StreamServerPort(int family, char *hostName, unsigned short portName,
265265
hp->h_length);
266266
}
267267

268-
saddr.in.sin_port = htons(portName);
268+
saddr.in.sin_port = htons(portNumber);
269269
len = sizeof(struct sockaddr_in);
270270
}
271271

src/backend/postmaster/postmaster.c

Lines changed: 7 additions & 7 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.184 2000/11/13 23:37:52 momjian Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.185 2000/11/14 01:15:01 momjian Exp $
1515
*
1616
* NOTES
1717
*
@@ -113,7 +113,7 @@ static Dllist *BackendList;
113113
static Dllist *PortList;
114114

115115
/* The socket number we are listening for connections on */
116-
int PostPortName;
116+
int PostPortNumber;
117117
char * UnixSocketName;
118118
char * HostName;
119119

@@ -511,7 +511,7 @@ PostmasterMain(int argc, char *argv[])
511511
strcpy(original_extraoptions, optarg);
512512
break;
513513
case 'p':
514-
PostPortName = atoi(optarg);
514+
PostPortNumber = atoi(optarg);
515515
break;
516516
case 'S':
517517

@@ -616,7 +616,7 @@ PostmasterMain(int argc, char *argv[])
616616
if (NetServer)
617617
{
618618
status = StreamServerPort(AF_INET, HostName,
619-
(unsigned short) PostPortName, UnixSocketName,
619+
(unsigned short) PostPortNumber, UnixSocketName,
620620
&ServerSock_INET);
621621
if (status != STATUS_OK)
622622
{
@@ -628,7 +628,7 @@ PostmasterMain(int argc, char *argv[])
628628

629629
#ifdef HAVE_UNIX_SOCKETS
630630
status = StreamServerPort(AF_UNIX, HostName,
631-
(unsigned short) PostPortName, UnixSocketName,
631+
(unsigned short) PostPortNumber, UnixSocketName,
632632
&ServerSock_UNIX);
633633
if (status != STATUS_OK)
634634
{
@@ -639,7 +639,7 @@ PostmasterMain(int argc, char *argv[])
639639
#endif
640640

641641
/* set up shared memory and semaphores */
642-
reset_shared(PostPortName);
642+
reset_shared(PostPortNumber);
643643

644644
/* Init XLOG paths */
645645
snprintf(XLogDir, MAXPGPATH, "%s/pg_xlog", DataDir);
@@ -1619,7 +1619,7 @@ reaper(SIGNAL_ARGS)
16191619
ctime(&tnow));
16201620
fflush(stderr);
16211621
shmem_exit(0);
1622-
reset_shared(PostPortName);
1622+
reset_shared(PostPortNumber);
16231623
StartupPID = StartupDataBase();
16241624
return;
16251625
}

src/backend/utils/misc/guc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Support for grand unified configuration scheme, including SET
55
* command, configuration file, and command line options.
66
*
7-
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.18 2000/11/13 21:35:03 momjian Exp $
7+
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.19 2000/11/14 01:15:02 momjian Exp $
88
*
99
* Copyright 2000 by PostgreSQL Global Development Group
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
@@ -245,7 +245,7 @@ ConfigureNamesInt[] =
245245
DEF_MAXBACKENDS, 1, MAXBACKENDS},
246246
{"shared_buffers", PGC_POSTMASTER, &NBuffers,
247247
DEF_NBUFFERS, 16, INT_MAX},
248-
{"port", PGC_POSTMASTER, &PostPortName,
248+
{"port", PGC_POSTMASTER, &PostPortNumber,
249249
DEF_PGPORT, 1, 65535},
250250

251251
{"sort_mem", PGC_USERSET, &SortMem,
@@ -409,7 +409,7 @@ ResetAllOptions(void)
409409
}
410410

411411
if (getenv("PGPORT"))
412-
PostPortName = atoi(getenv("PGPORT"));
412+
PostPortNumber = atoi(getenv("PGPORT"));
413413
}
414414

415415

src/include/libpq/libpq.h

Lines changed: 2 additions & 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.40 2000/11/13 15:18:14 momjian Exp $
10+
* $Id: libpq.h,v 1.41 2000/11/14 01:15:04 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -56,7 +56,7 @@ extern char PQerrormsg[PQERRORMSG_LENGTH]; /* in libpq/util.c */
5656
* prototypes for functions in pqcomm.c
5757
*/
5858
extern int StreamServerPort(int family, char *hostName,
59-
unsigned short portName, char *unixSocketName, int *fdP);
59+
unsigned short portNumber, char *unixSocketName, int *fdP);
6060
extern int StreamConnection(int server_fd, Port *port);
6161
extern void StreamClose(int sock);
6262
extern void pq_init(void);

src/include/miscadmin.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $Id: miscadmin.h,v 1.70 2000/11/12 20:51:52 tgl Exp $
15+
* $Id: miscadmin.h,v 1.71 2000/11/14 01:15:03 momjian Exp $
1616
*
1717
* NOTES
1818
* some of the information in this file will be moved to
@@ -110,7 +110,7 @@ extern bool EnableSSL;
110110
extern bool SilentMode;
111111
extern int MaxBackends;
112112
extern int NBuffers;
113-
extern int PostPortName;
113+
extern int PostPortNumber;
114114

115115
/*****************************************************************************
116116
* pdir.h -- *

src/interfaces/libpq/fe-connect.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.146 2000/11/13 23:37:53 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.147 2000/11/14 01:15:06 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -342,13 +342,6 @@ PQconnectStart(const char *conninfo)
342342
conn->pgunixsocket = conn->pghost;
343343
conn->pghost = NULL;
344344
}
345-
if (conn->pghostaddr && conn->pghostaddr[0] == '/')
346-
{
347-
if (conn->pgunixsocket)
348-
free(conn->pgunixsocket);
349-
conn->pgunixsocket = conn->pghostaddr;
350-
conn->pghostaddr = NULL;
351-
}
352345

353346
/* ----------
354347
* Connect to the database
@@ -474,13 +467,6 @@ PQsetdbLogin(const char *pghost, const char *pgport, const char *pgoptions,
474467
conn->pgunixsocket = conn->pghost;
475468
conn->pghost = NULL;
476469
}
477-
if (conn->pghostaddr && conn->pghostaddr[0] == '/')
478-
{
479-
if (conn->pgunixsocket)
480-
free(conn->pgunixsocket);
481-
conn->pgunixsocket = conn->pghostaddr;
482-
conn->pghostaddr = NULL;
483-
}
484470

485471
if (pgtty == NULL)
486472
{

0 commit comments

Comments
 (0)