Index: openldap/libraries/liblber/io.c =================================================================== RCS file: /auto/integration/openldap/libraries/liblber/io.c,v retrieving revision 1.1.1.2 diff -u -r1.1.1.2 io.c --- openldap/libraries/liblber/io.c 7 Jun 2005 12:54:46 -0000 1.1.1.2 +++ openldap/libraries/liblber/io.c 16 Jun 2006 13:24:47 -0000 @@ -40,6 +40,10 @@ #include #include +#if defined(_MSC_VER) +#include +#endif + #ifdef HAVE_IO_H #include #endif @@ -551,7 +555,9 @@ } /* Did we run out of bytes? */ if ((char *)p == ber->ber_rwptr) { -#if defined( EWOULDBLOCK ) +#if defined(HAVE_WINSOCK) + WSASetLastError (WSAEWOULDBLOCK); +#elif defined( EWOULDBLOCK ) errno = EWOULDBLOCK; #elif defined( EAGAIN ) errno = EAGAIN; @@ -564,7 +570,9 @@ } if ( ber->ber_ptr == ber->ber_rwptr ) { -#if defined( EWOULDBLOCK ) +#if defined(HAVE_WINSOCK) + WSASetLastError (WSAEWOULDBLOCK); +#elif defined( EWOULDBLOCK ) errno = EWOULDBLOCK; #elif defined( EAGAIN ) errno = EAGAIN; @@ -583,7 +591,9 @@ } /* Not enough bytes? */ if (ber->ber_rwptr - (char *)p < llen) { -#if defined( EWOULDBLOCK ) +#if defined(HAVE_WINSOCK) + WSASetLastError (WSAEWOULDBLOCK); +#elif defined( EWOULDBLOCK ) errno = EWOULDBLOCK; #elif defined( EAGAIN ) errno = EAGAIN; @@ -680,7 +690,9 @@ ber->ber_rwptr+=res; if (res #include +#if defined(_MSC_VER) +#include +#endif + #include "ldap-int.h" #include "ldap_log.h" @@ -489,10 +493,13 @@ "ber_get_next failed.\n", 0, 0, 0 ); #endif #endif -#ifdef EWOULDBLOCK - if (errno==EWOULDBLOCK) return -2; +#if defined(HAVE_WINSOCK) + if (WSAGetLastError() == WSAEWOULDBLOCK) return -2; +#endif +#if defined (EWOULDBLOCK) + if (errno == EWOULDBLOCK) return -2; #endif -#ifdef EAGAIN +#if defined(EAGAIN) if (errno == EAGAIN) return -2; #endif ld->ld_errno = LDAP_SERVER_DOWN;