diff options
Diffstat (limited to 'libvncclient/sockets.c')
-rw-r--r-- | libvncclient/sockets.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libvncclient/sockets.c b/libvncclient/sockets.c index 334928e..4183192 100644 --- a/libvncclient/sockets.c +++ b/libvncclient/sockets.c @@ -262,6 +262,9 @@ WriteToRFBServer(rfbClient* client, char *buf, int n) j = write(client->sock, buf + i, (n - i)); if (j <= 0) { if (j < 0) { +#ifdef WIN32 + errno=WSAGetLastError(); +#endif if (errno == EWOULDBLOCK || #ifdef LIBVNCSERVER_ENOENT_WORKAROUND errno == ENOENT || @@ -735,8 +738,12 @@ int WaitForMessage(rfbClient* client,unsigned int usecs) FD_SET(client->sock,&fds); num=select(client->sock+1, &fds, NULL, NULL, &timeout); - if(num<0) + if(num<0) { +#ifdef WIN32 + errno=WSAGetLastError(); +#endif rfbClientLog("Waiting for message failed: %d (%s)\n",errno,strerror(errno)); + } return num; } |