mirror of
https://github.com/postgres/postgres.git
synced 2025-04-27 22:56:53 +03:00
Introduce HAVE_UNIX_SOCKETS symbol to replace repeatedly listing all the
unsupported platforms.
This commit is contained in:
parent
4b8f1bcb9c
commit
9b3d66ecbd
@ -11,7 +11,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.159 2000/08/07 00:51:30 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.160 2000/08/20 10:55:33 petere Exp $
|
||||
*
|
||||
* NOTES
|
||||
*
|
||||
@ -169,14 +169,12 @@ static volatile bool got_SIGHUP = false;
|
||||
*/
|
||||
static int ServerSock_INET = INVALID_SOCK; /* stream socket server */
|
||||
|
||||
#if !defined(__CYGWIN32__) && !defined(__QNX__)
|
||||
#ifdef HAVE_UNIX_SOCKETS
|
||||
static int ServerSock_UNIX = INVALID_SOCK; /* stream socket server */
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef USE_SSL
|
||||
static SSL_CTX *SSL_context = NULL; /* Global SSL context */
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -589,7 +587,7 @@ PostmasterMain(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(__CYGWIN32__) && !defined(__QNX__)
|
||||
#ifdef HAVE_UNIX_SOCKETS
|
||||
status = StreamServerPort(AF_UNIX, (unsigned short)PostPortName, &ServerSock_UNIX);
|
||||
if (status != STATUS_OK)
|
||||
{
|
||||
@ -856,7 +854,7 @@ ServerLoop(void)
|
||||
|
||||
/* new connection pending on our well-known port's socket */
|
||||
|
||||
#if !defined(__CYGWIN32__) && !defined(__QNX__)
|
||||
#ifdef HAVE_UNIX_SOCKETS
|
||||
if (ServerSock_UNIX != INVALID_SOCK &&
|
||||
FD_ISSET(ServerSock_UNIX, &rmask) &&
|
||||
(port = ConnCreate(ServerSock_UNIX)) != NULL)
|
||||
@ -1015,7 +1013,7 @@ initMasks(fd_set *rmask, fd_set *wmask)
|
||||
FD_ZERO(rmask);
|
||||
FD_ZERO(wmask);
|
||||
|
||||
#if !defined(__CYGWIN32__) && !defined(__QNX__)
|
||||
#ifdef HAVE_UNIX_SOCKETS
|
||||
if (ServerSock_UNIX != INVALID_SOCK)
|
||||
{
|
||||
FD_SET(ServerSock_UNIX, rmask);
|
||||
@ -1832,7 +1830,7 @@ DoBackend(Port *port)
|
||||
if (NetServer)
|
||||
StreamClose(ServerSock_INET);
|
||||
ServerSock_INET = INVALID_SOCK;
|
||||
#if !defined(__CYGWIN32__) && !defined(__QNX__)
|
||||
#ifdef HAVE_UNIX_SOCKETS
|
||||
StreamClose(ServerSock_UNIX);
|
||||
ServerSock_UNIX = INVALID_SOCK;
|
||||
#endif
|
||||
@ -1962,7 +1960,7 @@ ExitPostmaster(int status)
|
||||
if (ServerSock_INET != INVALID_SOCK)
|
||||
StreamClose(ServerSock_INET);
|
||||
ServerSock_INET = INVALID_SOCK;
|
||||
#if !defined(__CYGWIN32__) && !defined(__QNX__)
|
||||
#ifdef HAVE_UNIX_SOCKETS
|
||||
if (ServerSock_UNIX != INVALID_SOCK)
|
||||
StreamClose(ServerSock_UNIX);
|
||||
ServerSock_UNIX = INVALID_SOCK;
|
||||
@ -2134,7 +2132,7 @@ SSDataBase(bool startup)
|
||||
if (NetServer)
|
||||
StreamClose(ServerSock_INET);
|
||||
ServerSock_INET = INVALID_SOCK;
|
||||
#if !defined(__CYGWIN32__) && !defined(__QNX__)
|
||||
#ifdef HAVE_UNIX_SOCKETS
|
||||
StreamClose(ServerSock_UNIX);
|
||||
ServerSock_UNIX = INVALID_SOCK;
|
||||
#endif
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright 2000 by PostgreSQL Global Development Group
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/prompt.c,v 1.12 2000/04/12 17:16:23 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/prompt.c,v 1.13 2000/08/20 10:55:34 petere Exp $
|
||||
*/
|
||||
#include "postgres.h"
|
||||
#include "prompt.h"
|
||||
@ -19,9 +19,9 @@
|
||||
#include <win32.h>
|
||||
#endif
|
||||
|
||||
#if !defined(WIN32) && !defined(__CYGWIN32__) && !defined(__QNX__)
|
||||
#include <unistd.h>
|
||||
#include <netdb.h>
|
||||
#ifdef HAVE_UNIX_SOCKETS
|
||||
# include <unistd.h>
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
|
||||
/*--------------------------
|
||||
@ -64,7 +64,7 @@
|
||||
/*
|
||||
* We need hostname information, only if connection is via UNIX socket
|
||||
*/
|
||||
#if !defined(WIN32) && !defined(__CYGWIN32__) && !defined(__QNX__)
|
||||
#ifdef HAVE_UNIX_SOCKETS
|
||||
|
||||
#define DOMAINNAME 1
|
||||
#define HOSTNAME 2
|
||||
@ -104,7 +104,8 @@ localhost(int type, char *buf, int siz)
|
||||
return buf;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* HAVE_UNIX_SOCKETS */
|
||||
|
||||
|
||||
char *
|
||||
get_prompt(promptStatus_t status)
|
||||
@ -173,7 +174,7 @@ get_prompt(promptStatus_t status)
|
||||
buf[strcspn(buf, ".")] = '\0';
|
||||
}
|
||||
/* UNIX socket */
|
||||
#if !defined(WIN32) && !defined(__CYGWIN32__) && !defined(__QNX__)
|
||||
#ifdef HAVE_UNIX_SOCKETS
|
||||
else
|
||||
{
|
||||
if (*p == 'm')
|
||||
@ -181,7 +182,7 @@ get_prompt(promptStatus_t status)
|
||||
else
|
||||
localhost(DOMAINNAME, buf, MAX_PROMPT_SIZE);
|
||||
}
|
||||
#endif
|
||||
#endif /* HAVE_UNIX_SOCKETS */
|
||||
}
|
||||
break;
|
||||
/* DB server port number */
|
||||
|
@ -8,7 +8,7 @@
|
||||
* or in config.h afterwards. Of course, if you edit config.h, then your
|
||||
* changes will be overwritten the next time you run configure.
|
||||
*
|
||||
* $Id: config.h.in,v 1.130 2000/08/07 20:15:44 tgl Exp $
|
||||
* $Id: config.h.in,v 1.131 2000/08/20 10:55:34 petere Exp $
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
@ -223,6 +223,14 @@
|
||||
*/
|
||||
#define BITSPERBYTE 8
|
||||
|
||||
/*
|
||||
* Define this is your operating system kernel supports AF_UNIX family
|
||||
* sockets.
|
||||
*/
|
||||
#if !defined(__CYGWIN32__) && !defined(__QNX__)
|
||||
# define HAVE_UNIX_SOCKETS 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
*------------------------------------------------------------------------
|
||||
* These hand-configurable symbols are for enabling debugging code,
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.131 2000/07/09 13:14:17 petere Exp $
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.132 2000/08/20 10:55:35 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -738,7 +738,7 @@ connectDBStart(PGconn *conn)
|
||||
conn->raddr.in.sin_port = htons((unsigned short) (portno));
|
||||
conn->raddr_len = sizeof(struct sockaddr_in);
|
||||
}
|
||||
#if !defined(WIN32) && !defined(__CYGWIN32__)
|
||||
#ifdef HAVE_UNIX_SOCKETS
|
||||
else
|
||||
conn->raddr_len = UNIXSOCK_PATH(conn->raddr.un, portno);
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user