psql: Remove one use of HAVE_UNIX_SOCKETS
authorPeter Eisentraut <peter@eisentraut.org>
Mon, 10 Feb 2020 18:27:05 +0000 (19:27 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Mon, 10 Feb 2020 18:27:05 +0000 (19:27 +0100)
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.

Discussion: https://www.postgresql.org/message-id/flat/54bde68c-d134-4eb8-5bd3-8af33b72a010@2ndquadrant.com

src/bin/psql/prompt.c

index 26592b328725c7accd4c4a40ec0434f1bd659be9..ef503ec41bb48bfba1a8d91567b15721a219d337 100644 (file)
 #include <win32.h>
 #endif
 
-#ifdef HAVE_UNIX_SOCKETS
-#include <unistd.h>
-#include <netdb.h>
-#endif
-
 #include "common.h"
 #include "common/string.h"
 #include "input.h"
@@ -147,7 +142,6 @@ get_prompt(promptStatus_t status, ConditionalStack cstack)
                            if (*p == 'm')
                                buf[strcspn(buf, ".")] = '\0';
                        }
-#ifdef HAVE_UNIX_SOCKETS
                        /* UNIX socket */
                        else
                        {
@@ -158,7 +152,6 @@ get_prompt(promptStatus_t status, ConditionalStack cstack)
                            else
                                snprintf(buf, sizeof(buf), "[local:%s]", host);
                        }
-#endif
                    }
                    break;
                    /* DB server port number */