1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

windows: must test socket against LWS_SOCK_INVALID

This commit is contained in:
Andy Green 2018-05-17 09:09:37 +08:00
parent 3d96df62d0
commit 8527764095

View file

@ -355,7 +355,7 @@ lws_create_adopt_udp(struct lws_vhost *vhost, int port, int flags,
for (rp = r; rp; rp = rp->ai_next) {
sock.sockfd = socket(rp->ai_family, rp->ai_socktype,
rp->ai_protocol);
if (sock.sockfd >= 0)
if (sock.sockfd != LWS_SOCK_INVALID)
break;
}
if (!rp) {
@ -381,7 +381,7 @@ lws_create_adopt_udp(struct lws_vhost *vhost, int port, int flags,
bail2:
if (!wsi)
close((int)sock.sockfd);
compatible_close((int)sock.sockfd);
bail1:
freeaddrinfo(r);