From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JpB3j-0007MI-6C for qemu-devel@nongnu.org; Thu, 24 Apr 2008 19:40:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JpB3i-0007L9-EN for qemu-devel@nongnu.org; Thu, 24 Apr 2008 19:40:58 -0400 Received: from [199.232.76.173] (port=41859 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JpB3i-0007L6-Ai for qemu-devel@nongnu.org; Thu, 24 Apr 2008 19:40:58 -0400 Received: from savannah.gnu.org ([199.232.41.3] helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JpB3g-0006X5-It for qemu-devel@nongnu.org; Thu, 24 Apr 2008 19:40:57 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1JpB3f-00029I-UD for qemu-devel@nongnu.org; Thu, 24 Apr 2008 23:40:56 +0000 Received: from balrog by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1JpB3f-00029B-Ko for qemu-devel@nongnu.org; Thu, 24 Apr 2008 23:40:55 +0000 MIME-Version: 1.0 Errors-To: balrog Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Andrzej Zaborowski Message-Id: Date: Thu, 24 Apr 2008 23:40:55 +0000 Subject: [Qemu-devel] [4251] Fix spurious VNC disconnects on Win32 (Herv?\195?\169 Poussineau). Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 4251 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4251 Author: balrog Date: 2008-04-24 23:40:55 +0000 (Thu, 24 Apr 2008) Log Message: ----------- Fix spurious VNC disconnects on Win32 (Herv?\195?\169 Poussineau). Modified Paths: -------------- trunk/vnc.c Modified: trunk/vnc.c =================================================================== --- trunk/vnc.c 2008-04-24 21:11:41 UTC (rev 4250) +++ trunk/vnc.c 2008-04-24 23:40:55 UTC (rev 4251) @@ -633,8 +633,18 @@ 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 @@ 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;