aboutsummaryrefslogtreecommitdiff
path: root/vnc.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-24 23:40:55 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-24 23:40:55 +0000
commitea01e5fd490be41f7876372e5acafb1f1d580478 (patch)
tree988ec7b25dd09d113c13d761f3ac562f0f8d678b /vnc.c
parent171cd1cdfff32a99855ec80ca8cab43384fe0600 (diff)
Fix spurious VNC disconnects on Win32 (Hervé Poussineau).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4251 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vnc.c')
-rw-r--r--vnc.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/vnc.c b/vnc.c
index 2179d38d08..842124b056 100644
--- a/vnc.c
+++ b/vnc.c
@@ -633,8 +633,18 @@ static void buffer_append(Buffer *buffer, const void *data, size_t len)
static int vnc_client_io_error(VncState *vs, int ret, int last_errno)
{
if (ret == 0 || ret == -1) {
- if (ret == -1 && (last_errno == EINTR || last_errno == EAGAIN))
- return 0;
+ if (ret == -1) {
+ switch (last_errno) {
+ case EINTR:
+ case EAGAIN:
+#ifdef _WIN32
+ case WSAEWOULDBLOCK:
+#endif
+ return 0;
+ default:
+ break;
+ }
+ }
VNC_DEBUG("Closing down client sock %d %d\n", ret, ret < 0 ? last_errno : 0);
qemu_set_fd_handler2(vs->csock, NULL, NULL, NULL, NULL);
@@ -2086,10 +2096,10 @@ int vnc_display_open(DisplayState *ds, const char *display)
struct sockaddr_in iaddr;
#ifndef _WIN32
struct sockaddr_un uaddr;
+ const char *p;
#endif
int reuse_addr, ret;
socklen_t addrlen;
- const char *p;
VncState *vs = ds ? (VncState *)ds->opaque : vnc_state;
const char *options;
int password = 0;