summaryrefslogtreecommitdiffstats
path: root/libvncserver/rfbserver.c
diff options
context:
space:
mode:
authorChristian Beier <[email protected]>2011-03-03 16:11:38 +0100
committerChristian Beier <[email protected]>2011-03-03 16:11:38 +0100
commitcf72a0f7c35ee791d5b4a81ef799d006e1b16bda (patch)
tree2d4029c928a844b9b8c335c3b6c0730053f1e694 /libvncserver/rfbserver.c
parentf5b96e57bfaa05d21efc98f892a1b2b109b17253 (diff)
downloadlibtdevnc-cf72a0f7c35ee791d5b4a81ef799d006e1b16bda.tar.gz
libtdevnc-cf72a0f7c35ee791d5b4a81ef799d006e1b16bda.zip
Call WSAGetLastError() everywhere errno is read after a Winsock call.
Winsock does NOT update errno for us, we have fetch the last error manually using WSAGetLastError().
Diffstat (limited to 'libvncserver/rfbserver.c')
-rw-r--r--libvncserver/rfbserver.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c
index 554c118..73be34c 100644
--- a/libvncserver/rfbserver.c
+++ b/libvncserver/rfbserver.c
@@ -1350,6 +1350,9 @@ rfbBool rfbSendFileTransferChunk(rfbClientPtr cl)
n = select(cl->sock + 1, NULL, &wfds, NULL, &tv);
if (n<0) {
+#ifdef WIN32
+ errno=WSAGetLastError();
+#endif
rfbLog("rfbSendFileTransferChunk() select failed: %s\n", strerror(errno));
}
/* We have space on the transmit queue */
@@ -1369,6 +1372,9 @@ rfbBool rfbSendFileTransferChunk(rfbClientPtr cl)
return retval;
case -1:
/* TODO : send an error msg to the client... */
+#ifdef WIN32
+ errno=WSAGetLastError();
+#endif
rfbLog("rfbSendFileTransferChunk(): %s\n",strerror(errno));
retval = rfbSendFileTransferMessage(cl, rfbAbortFileTransfer, 0, 0, 0, NULL);
close(cl->fileTransfer.fd);