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:
parent
3d96df62d0
commit
8527764095
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue