aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-connect.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-04-22 02:06:16 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2017-04-22 02:06:16 -0400
commit5041cdf2b79216b10ca90498d9a9b8fd4abf1745 (patch)
treef930524b5292bd03872dba8ce03bf40374a68df3 /src/interfaces/libpq/fe-connect.c
parentf58b664393dcfd02c2f57b3ff20fc0aee6dfebf1 (diff)
downloadpostgresql-5041cdf2b79216b10ca90498d9a9b8fd4abf1745.tar.gz
postgresql-5041cdf2b79216b10ca90498d9a9b8fd4abf1745.zip
Partially revert commit 536d47bd9d5fce8d91929bee3128fa1d08dbcc57.
Per buildfarm, the "#ifdef F_SETFD" removed in that commit actually is needed on Windows, because fcntl() isn't available at all on that platform, unless using Cygwin. We could perhaps spell it more like "#ifdef HAVE_FCNTL", or "#ifndef WIN32", but it's not clear that those choices are better. It does seem that we don't need the bogus manual definition of FD_CLOEXEC, though, so keep that change. Discussion: https://postgr.es/m/26254.1492805635@sss.pgh.pa.us
Diffstat (limited to 'src/interfaces/libpq/fe-connect.c')
-rw-r--r--src/interfaces/libpq/fe-connect.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 1b7175d9ef9..74e26edad66 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -1983,6 +1983,7 @@ keep_going: /* We will come back to here until there is
continue;
}
+#ifdef F_SETFD
if (fcntl(conn->sock, F_SETFD, FD_CLOEXEC) == -1)
{
appendPQExpBuffer(&conn->errorMessage,
@@ -1992,6 +1993,7 @@ keep_going: /* We will come back to here until there is
conn->addr_cur = addr_cur->ai_next;
continue;
}
+#endif /* F_SETFD */
if (!IS_AF_UNIX(addr_cur->ai_family))
{