v2-0003-psql-Remove-one-use-of-HAVE_UNIX_SOCKETS.patch

text/plain

Filename: v2-0003-psql-Remove-one-use-of-HAVE_UNIX_SOCKETS.patch
Type: text/plain
Part: 2
Message: Re: Unix-domain socket support on Windows

Patch

Format: format-patch
Series: patch v2-0003
Subject: psql: Remove one use of HAVE_UNIX_SOCKETS
File+
src/bin/psql/prompt.c 0 7
From 6c6a7f4a0fdf165b5fee5bdd1dab88388cc2f623 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Wed, 7 Aug 2019 15:44:19 +0200
Subject: [PATCH v2 3/7] psql: Remove one use of HAVE_UNIX_SOCKETS

This use was not protecting any unportable code, it was just omitting
the code because it wouldn't be used.  Remove the use to reduce code
complexity a bit.
---
 src/bin/psql/prompt.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/src/bin/psql/prompt.c b/src/bin/psql/prompt.c
index 0fcb8c7783..f8edc942da 100644
--- a/src/bin/psql/prompt.c
+++ b/src/bin/psql/prompt.c
@@ -12,11 +12,6 @@
 #include <win32.h>
 #endif
 
-#ifdef HAVE_UNIX_SOCKETS
-#include <unistd.h>
-#include <netdb.h>
-#endif
-
 #include "common.h"
 #include "input.h"
 #include "prompt.h"
@@ -139,7 +134,6 @@ get_prompt(promptStatus_t status, ConditionalStack cstack)
 							if (*p == 'm')
 								buf[strcspn(buf, ".")] = '\0';
 						}
-#ifdef HAVE_UNIX_SOCKETS
 						/* UNIX socket */
 						else
 						{
@@ -150,7 +144,6 @@ get_prompt(promptStatus_t status, ConditionalStack cstack)
 							else
 								snprintf(buf, sizeof(buf), "[local:%s]", host);
 						}
-#endif
 					}
 					break;
 					/* DB server port number */
-- 
2.22.0