Rename PortName to PortNumber.
authorBruce Momjian
Tue, 14 Nov 2000 01:15:06 +0000 (01:15 +0000)
committerBruce Momjian
Tue, 14 Nov 2000 01:15:06 +0000 (01:15 +0000)
src/backend/libpq/pqcomm.c
src/backend/postmaster/postmaster.c
src/backend/utils/misc/guc.c
src/include/libpq/libpq.h
src/include/miscadmin.h
src/interfaces/libpq/fe-connect.c

index 98ece64286091bd96814b3754a5aa57d6aa6d00d..9ff33694904fced579be854219389dbc13d33248 100644 (file)
@@ -29,7 +29,7 @@
  * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: pqcomm.c,v 1.111 2000/11/13 21:31:46 momjian Exp $
+ * $Id: pqcomm.c,v 1.112 2000/11/14 01:15:00 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -175,7 +175,7 @@ StreamDoUnlink(void)
  */
 
 int
-StreamServerPort(int family, char *hostName, unsigned short portName,
+StreamServerPort(int family, char *hostName, unsigned short portNumber,
                 char *unixSocketName, int *fdP)
 {
    SockAddr    saddr;
@@ -219,7 +219,7 @@ StreamServerPort(int family, char *hostName, unsigned short portName,
 #ifdef HAVE_UNIX_SOCKETS
    if (family == AF_UNIX)
    {
-       UNIXSOCK_PATH(saddr.un, portName, unixSocketName);
+       UNIXSOCK_PATH(saddr.un, portNumber, unixSocketName);
        len = UNIXSOCK_LEN(saddr.un);
        strcpy(sock_path, saddr.un.sun_path);
        /*
@@ -265,7 +265,7 @@ StreamServerPort(int family, char *hostName, unsigned short portName,
                    hp->h_length);
        }
    
-       saddr.in.sin_port = htons(portName);
+       saddr.in.sin_port = htons(portNumber);
        len = sizeof(struct sockaddr_in);
    }
 
index b9d4973013842bdeb633825eb193b058d4f963fb..614f482ba5040aebf170c5eddf2bd3219f20856d 100644 (file)
@@ -11,7 +11,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.184 2000/11/13 23:37:52 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.185 2000/11/14 01:15:01 momjian Exp $
  *
  * NOTES
  *
@@ -113,7 +113,7 @@ static Dllist *BackendList;
 static Dllist *PortList;
 
 /* The socket number we are listening for connections on */
-int PostPortName;
+int PostPortNumber;
 char * UnixSocketName;
 char * HostName;
 
@@ -511,7 +511,7 @@ PostmasterMain(int argc, char *argv[])
                strcpy(original_extraoptions, optarg);
                break;
            case 'p':
-               PostPortName = atoi(optarg);
+               PostPortNumber = atoi(optarg);
                break;
            case 'S':
 
@@ -616,7 +616,7 @@ PostmasterMain(int argc, char *argv[])
    if (NetServer)
    {
        status = StreamServerPort(AF_INET, HostName,
-                       (unsigned short) PostPortName, UnixSocketName,
+                       (unsigned short) PostPortNumber, UnixSocketName,
                        &ServerSock_INET);
        if (status != STATUS_OK)
        {
@@ -628,7 +628,7 @@ PostmasterMain(int argc, char *argv[])
 
 #ifdef HAVE_UNIX_SOCKETS
    status = StreamServerPort(AF_UNIX, HostName,
-                       (unsigned short) PostPortName, UnixSocketName, 
+                       (unsigned short) PostPortNumber, UnixSocketName, 
                        &ServerSock_UNIX);
    if (status != STATUS_OK)
    {
@@ -639,7 +639,7 @@ PostmasterMain(int argc, char *argv[])
 #endif
 
    /* set up shared memory and semaphores */
-   reset_shared(PostPortName);
+   reset_shared(PostPortNumber);
 
    /* Init XLOG paths */
    snprintf(XLogDir, MAXPGPATH, "%s/pg_xlog", DataDir);
@@ -1619,7 +1619,7 @@ reaper(SIGNAL_ARGS)
                ctime(&tnow));
        fflush(stderr);
        shmem_exit(0);
-       reset_shared(PostPortName);
+       reset_shared(PostPortNumber);
        StartupPID = StartupDataBase();
        return;
    }
index 88c20a2ac091f7a4e25cb01cd4cb4c2df3f98583..1ce8186b7cb44600260e52c523e052caafc6ee07 100644 (file)
@@ -4,7 +4,7 @@
  * Support for grand unified configuration scheme, including SET
  * command, configuration file, and command line options.
  *
- * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.18 2000/11/13 21:35:03 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.19 2000/11/14 01:15:02 momjian Exp $
  *
  * Copyright 2000 by PostgreSQL Global Development Group
  * Written by Peter Eisentraut .
@@ -245,7 +245,7 @@ ConfigureNamesInt[] =
     DEF_MAXBACKENDS, 1, MAXBACKENDS},
    {"shared_buffers",          PGC_POSTMASTER,         &NBuffers,
     DEF_NBUFFERS, 16, INT_MAX},
-   {"port",                    PGC_POSTMASTER,         &PostPortName,
+   {"port",                    PGC_POSTMASTER,         &PostPortNumber,
     DEF_PGPORT, 1, 65535},
 
    {"sort_mem",                PGC_USERSET,            &SortMem,
@@ -409,7 +409,7 @@ ResetAllOptions(void)
    }
 
    if (getenv("PGPORT"))
-       PostPortName = atoi(getenv("PGPORT"));
+       PostPortNumber = atoi(getenv("PGPORT"));
 }
 
 
index 21cae47d97af5a990e5f47458430a6f8e1a188a4..c86862317c82ac05395d10994c3828f7a8582905 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: libpq.h,v 1.40 2000/11/13 15:18:14 momjian Exp $
+ * $Id: libpq.h,v 1.41 2000/11/14 01:15:04 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -56,7 +56,7 @@ extern char PQerrormsg[PQERRORMSG_LENGTH];        /* in libpq/util.c */
  * prototypes for functions in pqcomm.c
  */
 extern int StreamServerPort(int family, char *hostName,
-           unsigned short portName, char *unixSocketName, int *fdP);
+           unsigned short portNumber, char *unixSocketName, int *fdP);
 extern int StreamConnection(int server_fd, Port *port);
 extern void StreamClose(int sock);
 extern void pq_init(void);
index 7b684291a33606008a7bca5edd9b6d7b0a4cf717..afa88a77434647db4e7f11850a562dbe20f6e682 100644 (file)
@@ -12,7 +12,7 @@
  * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: miscadmin.h,v 1.70 2000/11/12 20:51:52 tgl Exp $
+ * $Id: miscadmin.h,v 1.71 2000/11/14 01:15:03 momjian Exp $
  *
  * NOTES
  *   some of the information in this file will be moved to
@@ -110,7 +110,7 @@ extern bool EnableSSL;
 extern bool SilentMode;
 extern int MaxBackends;
 extern int NBuffers;
-extern int PostPortName;
+extern int PostPortNumber;
 
 /*****************************************************************************
  *   pdir.h --                                                              *
index 9c720c12a1c2fd8dd0d8850534749c0e4ad0d7e6..a26f7ac5cc0e93ac3ce121ad47da6a18aff5b90d 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.146 2000/11/13 23:37:53 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.147 2000/11/14 01:15:06 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -342,13 +342,6 @@ PQconnectStart(const char *conninfo)
        conn->pgunixsocket = conn->pghost;
        conn->pghost = NULL;
    }
-   if (conn->pghostaddr && conn->pghostaddr[0] == '/')
-   {
-       if (conn->pgunixsocket)
-           free(conn->pgunixsocket);
-       conn->pgunixsocket = conn->pghostaddr;
-       conn->pghostaddr = NULL;
-   }
 
    /* ----------
     * Connect to the database
@@ -474,13 +467,6 @@ PQsetdbLogin(const char *pghost, const char *pgport, const char *pgoptions,
        conn->pgunixsocket = conn->pghost;
        conn->pghost = NULL;
    }
-   if (conn->pghostaddr && conn->pghostaddr[0] == '/')
-   {
-       if (conn->pgunixsocket)
-           free(conn->pgunixsocket);
-       conn->pgunixsocket = conn->pghostaddr;
-       conn->pghostaddr = NULL;
-   }
 
    if (pgtty == NULL)
    {