From e86e39ad311e12c79967c2da07fd9f0a1c513188 Mon Sep 17 00:00:00 2001 From: Gary Williams Date: Thu, 1 Apr 1999 16:00:24 +0000 Subject: [PATCH] NT port --- libraries/liblber/sockbuf.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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 ); -- 2.39.5