From: Gary Williams Date: Thu, 1 Apr 1999 16:00:24 +0000 (+0000) Subject: NT port X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~291 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e86e39ad311e12c79967c2da07fd9f0a1c513188;p=openldap NT port --- diff --git a/libraries/liblber/sockbuf.c b/libraries/liblber/sockbuf.c index 8eb9bb3797..8f2696d949 100644 --- a/libraries/liblber/sockbuf.c +++ b/libraries/liblber/sockbuf.c @@ -765,7 +765,12 @@ stream_read( Sockbuf *sb, void *buf, long len ) /* * 32-bit Windows Socket API (under Windows NT or Windows 95) */ - return recv( lber_pvt_sb_get_desc(sb), buf, len, 0 ); + int rc; + rc = recv( lber_pvt_sb_get_desc(sb), buf, len, 0 ); +#ifdef HAVE_WINSOCK + if ( rc < 0 ) errno = WSAGetLastError(); +#endif + return rc; #elif defined( HAVE_NCSA ) /* @@ -801,7 +806,12 @@ stream_write( Sockbuf *sb, void *buf, long len ) /* * 32-bit Windows Socket API (under Windows NT or Windows 95) */ - return send( lber_pvt_sb_get_desc(sb), buf, len, 0 ); + int rc; + rc = send( lber_pvt_sb_get_desc(sb), buf, len, 0 ); +#ifdef HAVE_WINSOCK + if ( rc < 0 ) errno = WSAGetLastError(); +#endif + return rc; #elif defined(HAVE_NCSA) return netwrite( lber_pvt_sb_get_desc(sb), buf, len );