Skip to content

Commit 5041cdf

Browse files
committed
Partially revert commit 536d47b.
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
1 parent f58b664 commit 5041cdf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/interfaces/libpq/fe-connect.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,6 +1983,7 @@ PQconnectPoll(PGconn *conn)
19831983
continue;
19841984
}
19851985

1986+
#ifdef F_SETFD
19861987
if (fcntl(conn->sock, F_SETFD, FD_CLOEXEC) == -1)
19871988
{
19881989
appendPQExpBuffer(&conn->errorMessage,
@@ -1992,6 +1993,7 @@ PQconnectPoll(PGconn *conn)
19921993
conn->addr_cur = addr_cur->ai_next;
19931994
continue;
19941995
}
1996+
#endif /* F_SETFD */
19951997

19961998
if (!IS_AF_UNIX(addr_cur->ai_family))
19971999
{

0 commit comments

Comments
 (0)