]> source.dussan.org Git - tigervnc.git/commitdiff
Applied vnc-restart.patch from FC3 package.
authorPeter Åstrand <astrand@cendio.se>
Mon, 14 Feb 2005 12:58:45 +0000 (12:58 +0000)
committerPeter Åstrand <astrand@cendio.se>
Mon, 14 Feb 2005 12:58:45 +0000 (12:58 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@182 3789f03b-4d11-0410-bbf8-ca57d06f2519

network/TcpSocket.cxx

index b536e6737cd3910f21d8ed5c0828e068ebb96028..4c4e8d3d0e57a0a4b22971cded345c2dba6e3358 100644 (file)
@@ -111,10 +111,14 @@ TcpSocket::TcpSocket(const char *host, int port)
   }
 
   // Attempt to connect to the remote host
-  if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) != 0) {
-    int e = errorNumber;
-    closesocket(sock);
-    throw SocketException("unable to connect to host", e);
+  for (;;) {
+    if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) != 0) {
+      int e = errorNumber;
+      if (e == EINTR)
+       continue;
+      closesocket(sock);
+      throw SocketException("unable to connect to host", e);
+    } else break;
   }
 
   int one = 1;