diff --git a/lib/core-net/client/connect3.c b/lib/core-net/client/connect3.c index ec069f3f1..0f6b901b9 100644 --- a/lib/core-net/client/connect3.c +++ b/lib/core-net/client/connect3.c @@ -73,9 +73,11 @@ typedef enum { static lcccr_t lws_client_connect_check(struct lws *wsi) { - int e = 0; int en = 0; +#if !defined(WIN32) + int e; socklen_t sl = sizeof(e); +#endif (void)en; @@ -84,10 +86,8 @@ lws_client_connect_check(struct lws *wsi) * condition, the connect definitively failed. */ +#if !defined(WIN32) if (!getsockopt(wsi->desc.sockfd, SOL_SOCKET, SO_ERROR, -#if defined(WIN32) - (char *) -#endif &e, &sl)) { en = LWS_ERRNO; if (!e) { @@ -101,7 +101,7 @@ lws_client_connect_check(struct lws *wsi) wsi->desc.sockfd, e); } -#if defined(WIN32) +#else if (!connect(wsi->desc.sockfd, NULL, 0)) return LCCCR_CONNECTED;