summaryrefslogtreecommitdiffstats
path: root/libcutils
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-05-20 00:23:11 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-20 00:23:11 +0000
commit5756d8873b0ab9c7d36b753728662b20424bd4e9 (patch)
treee374bb69e85d57d661efd267d2d014d3659346d9 /libcutils
parent3edc25271fd6696cede2d0e6ecdcaf3d6cc273a5 (diff)
parent87d0f45b3c30dff02bd92f542e5e9e64816f5315 (diff)
downloadsystem_core-5756d8873b0ab9c7d36b753728662b20424bd4e9.zip
system_core-5756d8873b0ab9c7d36b753728662b20424bd4e9.tar.gz
system_core-5756d8873b0ab9c7d36b753728662b20424bd4e9.tar.bz2
am 87d0f45b: am 2dea56e0: am 9e0a6248: Merge "Fix Windows socket_network_client.c build failures."
* commit '87d0f45b3c30dff02bd92f542e5e9e64816f5315': Fix Windows socket_network_client.c build failures.
Diffstat (limited to 'libcutils')
-rw-r--r--libcutils/socket_network_client.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libcutils/socket_network_client.c b/libcutils/socket_network_client.c
index 4862949..8a8474e 100644
--- a/libcutils/socket_network_client.c
+++ b/libcutils/socket_network_client.c
@@ -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
}
-