Skip to content

Commit 9e0a624

Browse files
enh-googleGerrit Code Review
authored andcommitted
Merge "Fix Windows socket_network_client.c build failures."
2 parents 9cae50b + 3673955 commit 9e0a624

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

libcutils/socket_network_client.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ int socket_network_client_timeout(const char *host, int port, int type, int time
6868
s = socket(hp->h_addrtype, type, 0);
6969
if (s < 0) return -1;
7070

71+
#ifdef HAVE_WINSOCK
72+
if (connect(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
73+
close(s);
74+
return -1;
75+
}
76+
return s;
77+
#else
7178
if ((flags = fcntl(s, F_GETFL, 0)) < 0) {
7279
close(s);
7380
return -1;
@@ -125,5 +132,5 @@ int socket_network_client_timeout(const char *host, int port, int type, int time
125132
}
126133

127134
return s;
135+
#endif
128136
}
129-

0 commit comments

Comments
 (0)