From 4ce84bb43f0fa2a1d557f61775779a77780ba679 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 3 Oct 2000 03:39:46 +0000 Subject: [PATCH] Cleanup of fe-connect ifdef platform problem added with beos. --- src/interfaces/libpq/fe-connect.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 0c580cb395..e014d243c2 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -620,14 +620,13 @@ static int connectMakeNonblocking(PGconn *conn) { #ifdef WIN32 - if (fcntl(conn->sock, F_SETFL, O_NONBLOCK) < 0) + int on = 1; + if (ioctlsocket(conn->sock, FIONBIO, &on) != 0) #elif defined(__BEOS__) int on = 1; if (ioctl(conn->sock, FIONBIO, &on) != 0) #else - int on = 1; - - if (ioctlsocket(conn->sock, FIONBIO, &on) != 0) + if (fcntl(conn->sock, F_SETFL, O_NONBLOCK) < 0) #endif { printfPQExpBuffer(&conn->errorMessage, -- 2.39.5