v3-0004-libpq-Remove-unnecessary-uses-of-HAVE_UNIX_SOCKET.patch

text/plain

Filename: v3-0004-libpq-Remove-unnecessary-uses-of-HAVE_UNIX_SOCKET.patch
Type: text/plain
Part: 3
Message: Re: Unix-domain socket support on Windows

Patch

Format: format-patch
Series: patch v3-0004
Subject: libpq: Remove unnecessary uses of HAVE_UNIX_SOCKETS
File+
src/interfaces/libpq/fe-connect.c 0 7
From b7bfde70e748ae67bba183e874cd98ea7097fc83 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Wed, 7 Aug 2019 15:44:19 +0200
Subject: [PATCH v3 4/7] libpq: Remove unnecessary uses of HAVE_UNIX_SOCKETS

These are not protecting any unportable code and they were not used
consistently anyway (other code uses IS_AF_UNIX without
HAVE_UNIX_SOCKETS).
---
 src/interfaces/libpq/fe-connect.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index c013098982..79323114e4 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -1058,10 +1058,8 @@ connectOptions2(PGconn *conn)
 		else if (ch->host != NULL && ch->host[0] != '\0')
 		{
 			ch->type = CHT_HOST_NAME;
-#ifdef HAVE_UNIX_SOCKETS
 			if (is_absolute_path(ch->host))
 				ch->type = CHT_UNIX_SOCKET;
-#endif
 		}
 		else
 		{
@@ -1569,7 +1567,6 @@ connectFailureMessage(PGconn *conn, int errorno)
 {
 	char		sebuf[PG_STRERROR_R_BUFLEN];
 
-#ifdef HAVE_UNIX_SOCKETS
 	if (IS_AF_UNIX(conn->raddr.addr.ss_family))
 	{
 		char		service[NI_MAXHOST];
@@ -1586,7 +1583,6 @@ connectFailureMessage(PGconn *conn, int errorno)
 						  service);
 	}
 	else
-#endif							/* HAVE_UNIX_SOCKETS */
 	{
 		char		host_addr[NI_MAXHOST];
 		const char *displayed_host;
@@ -2676,8 +2672,6 @@ PQconnectPoll(PGconn *conn)
 				char	   *startpacket;
 				int			packetlen;
 
-#ifdef HAVE_UNIX_SOCKETS
-
 				/*
 				 * Implement requirepeer check, if requested and it's a
 				 * Unix-domain socket.
@@ -2736,7 +2730,6 @@ PQconnectPoll(PGconn *conn)
 					}
 #endif							/* WIN32 */
 				}
-#endif							/* HAVE_UNIX_SOCKETS */
 
 				if (IS_AF_UNIX(conn->raddr.addr.ss_family))
 				{
-- 
2.22.0