diff options
author | Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> | 2004-11-15 15:06:56 +0000 |
---|---|---|
committer | Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> | 2004-11-15 15:06:56 +0000 |
commit | 92e80a5a67273fc60623b17a5f34c239f1ed6947 (patch) | |
tree | c558ac6e0366b8e8243db7a7086dace1daed45e2 /Xtransdnet.c | |
parent | d92a9d31416a8366cd065886d7ff352fefce646d (diff) |
Bufzilla #1802, http://freedesktop.org/bugzilla/show_bug.cgi?id=1802 Addedxprint_packagertest_20041217_basexprint_packagertest_20041125_base
mingw (Win32) port
Diffstat (limited to 'Xtransdnet.c')
-rw-r--r-- | Xtransdnet.c | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/Xtransdnet.c b/Xtransdnet.c index 9bc3e17..ac91695 100644 --- a/Xtransdnet.c +++ b/Xtransdnet.c @@ -525,7 +525,11 @@ TRANS(DNETBytesReadable) (XtransConnInfo ciptr, BytesReadable_t *pend) PRMSG (2,"DNETBytesReadable(%x,%d,%x)\n", ciptr, ciptr->fd, pend); #ifdef WIN32 - return ioctlsocket ((SOCKET) ciptr->fd, FIONREAD, (u_long *) pend); + { + int ret = ioctlsocket ((SOCKET) ciptr->fd, FIONREAD, (u_long *) pend); + errno = WSAGetLastError(); + return ret; + } #else return ioctl(ciptr->fd, FIONREAD, (char *)pend); #endif /* WIN32 */ @@ -539,7 +543,11 @@ TRANS(DNETRead) (XtransConnInfo ciptr, char *buf, int size) PRMSG (2,"DNETRead(%d,%x,%d)\n", ciptr->fd, buf, size); #ifdef WIN32 - return recv ((SOCKET)ciptr->fd, buf, size, 0); + { + int ret = recv ((SOCKET)ciptr->fd, buf, size, 0); + errno = WSAGetLastError(); + return ret; + } #else return read (ciptr->fd, buf, size); #endif /* WIN32 */ @@ -553,7 +561,11 @@ TRANS(DNETWrite) (XtransConnInfo ciptr, char *buf, int size) PRMSG (2,"DNETWrite(%d,%x,%d)\n", ciptr->fd, buf, size); #ifdef WIN32 - return send ((SOCKET)ciptr->fd, buf, size, 0); + { + int ret = send ((SOCKET)ciptr->fd, buf, size, 0); + errno = WSAGetLastError(); + return ret; + } #else return write (ciptr->fd, buf, size); #endif /* WIN32 */ @@ -586,7 +598,15 @@ TRANS(DNETDisconnect) (XtransConnInfo ciptr) { PRMSG (2,"DNETDisconnect(%x,%d)\n", ciptr, ciptr->fd, 0); +#ifdef WIN32 + { + int ret = shutdown (ciptr->fd, 2); + errno = WSAGetLastError(); + return ret; + } +#else return shutdown (ciptr->fd, 2); /* disallow further sends and receives */ +#endif } @@ -596,7 +616,15 @@ TRANS(DNETClose) (XtransConnInfo ciptr) { PRMSG (2,"DNETClose(%x,%d)\n", ciptr, ciptr->fd, 0); +#ifdef WIN32 + { + int ret = close (ciptr->fd); + errno = WSAGetLastError(); + return ret; + } +#else return close (ciptr->fd); +#endif } |