on a socket with a pending error doesn't reset the error, so the socket is effectively useless. Use getsockopt(...SO_ERROR...) to clear the error status. The kernel should also be patched, but this patch is required for backwards compatibility.