--- tomcat-connectors-1.2.31-src/native/common/jk_connect.c.org	2010-10-21 21:30:57.000000000 +0200
+++ tomcat-connectors-1.2.31-src/native/common/jk_connect.c	2013-06-20 12:49:59.317752701 +0200
@@ -260,9 +260,11 @@
         if (!FD_ISSET(sd, &wfdset) ||
             (getsockopt(sd, SOL_SOCKET, SO_ERROR,
                         (char *)&rc, &rclen) < 0) || rc) {
-            if (rc)
-                errno = rc;
-            rc = -1;
+            if (errno != EINVAL || rc != 0) {
+                if (rc)
+                    errno = rc;
+                rc = -1;
+            }
         }
 #endif /* SO_ERROR */
     }
