summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-05-19 23:48:10 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-05-19 23:48:10 +0000
commit9e0a62487b9946c0403d6c4282010d28ae0b193e (patch)
treebb38d5b4c6761b296fe062d30de13718a227fe9b
parent9cae50b38d6a58efe0799ef3697f594cb4b100f9 (diff)
parent36739556db21352d056f9d0858d5c458d7a74636 (diff)
downloadsystem_core-9e0a62487b9946c0403d6c4282010d28ae0b193e.zip
system_core-9e0a62487b9946c0403d6c4282010d28ae0b193e.tar.gz
system_core-9e0a62487b9946c0403d6c4282010d28ae0b193e.tar.bz2
Merge "Fix Windows socket_network_client.c build failures."
-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
}
-