am 9e0a6248: Merge "Fix Windows socket_network_client.c build failures."
* commit '9e0a62487b9946c0403d6c4282010d28ae0b193e': Fix Windows socket_network_client.c build failures.
This commit is contained in:
commit
2dea56e05c
1 changed files with 8 additions and 1 deletions
|
|
@ -68,6 +68,13 @@ int socket_network_client_timeout(const char *host, int port, int type, int time
|
|||
s = socket(hp->h_addrtype, type, 0);
|
||||
if (s < 0) return -1;
|
||||
|
||||
#ifdef HAVE_WINSOCK
|
||||
if (connect(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
|
||||
close(s);
|
||||
return -1;
|
||||
}
|
||||
return s;
|
||||
#else
|
||||
if ((flags = fcntl(s, F_GETFL, 0)) < 0) {
|
||||
close(s);
|
||||
return -1;
|
||||
|
|
@ -125,5 +132,5 @@ done:
|
|||
}
|
||||
|
||||
return s;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue