diff options
| author | Bruce Momjian | 2003-05-15 16:35:30 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2003-05-15 16:35:30 +0000 |
| commit | 12c942383296bd626131241c012c2ab81b081738 (patch) | |
| tree | 7a37bb6990282b36be53fae1bde399d8e603e9f9 /src/interfaces/libpq | |
| parent | 2c0556068fc308ed9cce06c85de7e42305d34b86 (diff) | |
Allow Win32 to compile under MinGW. Major changes are:
Win32 port is now called 'win32' rather than 'win'
add -lwsock32 on Win32
make gethostname() be only used when kerberos4 is enabled
use /port/getopt.c
new /port/opendir.c routines
disable GUC unix_socket_group on Win32
convert some keywords.c symbols to KEYWORD_P to prevent conflict
create new FCNTL_NONBLOCK macro to turn off socket blocking
create new /include/port.h file that has /port prototypes, move
out of c.h
new /include/port/win32_include dir to hold missing include files
work around ERROR being defined in Win32 includes
Diffstat (limited to 'src/interfaces/libpq')
| -rw-r--r-- | src/interfaces/libpq/fe-auth.c | 6 | ||||
| -rw-r--r-- | src/interfaces/libpq/fe-connect.c | 14 |
2 files changed, 5 insertions, 15 deletions
diff --git a/src/interfaces/libpq/fe-auth.c b/src/interfaces/libpq/fe-auth.c index 10e2ee15f13..07c059f559b 100644 --- a/src/interfaces/libpq/fe-auth.c +++ b/src/interfaces/libpq/fe-auth.c @@ -10,7 +10,7 @@ * exceed INITIAL_EXPBUFFER_SIZE (currently 256 bytes). * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.76 2003/04/19 00:02:30 tgl Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.77 2003/05/15 16:35:30 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -386,10 +386,10 @@ pg_krb5_sendauth(char *PQerrormsg, int sock, /* * libpq uses a non-blocking socket. But kerberos needs a blocking * socket, and we have to block somehow to do mutual authentication - * anyway. So we temporarily make it blocking. + * anyway. So we temporarily make it blocking. Win32 doesn't support this. */ flags = fcntl(sock, F_GETFL); - if (flags < 0 || fcntl(sock, F_SETFL, (long) (flags & ~O_NONBLOCK))) + if (flags < 0 || fcntl(sock, F_SETFL, flags & ~O_NONBLOCK))) { snprintf(PQerrormsg, PQERRORMSG_LENGTH, libpq_gettext("could not set socket to blocking mode: %s\n"), strerror(errno)); diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 75bcb43433b..cf33c225dca 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.240 2003/05/05 00:44:56 tgl Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.241 2003/05/15 16:35:30 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -719,17 +719,7 @@ update_db_info(PGconn *conn) static int connectMakeNonblocking(PGconn *conn) { -#if defined(WIN32) || defined(__BEOS__) - int on = 1; -#endif - -#if defined(WIN32) - if (ioctlsocket(conn->sock, FIONBIO, &on) != 0) -#elif defined(__BEOS__) - if (ioctl(conn->sock, FIONBIO, &on) != 0) -#else - if (fcntl(conn->sock, F_SETFL, O_NONBLOCK) < 0) -#endif + if (FCNTL_NONBLOCK(conn->sock) < 0) { printfPQExpBuffer(&conn->errorMessage, libpq_gettext("could not set socket to non-blocking mode: %s\n"), |
