summaryrefslogtreecommitdiffstats
path: root/adb/transport_local.c
diff options
context:
space:
mode:
Diffstat (limited to 'adb/transport_local.c')
-rw-r--r--adb/transport_local.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/adb/transport_local.c b/adb/transport_local.c
index 0e8b732..be01f29 100644
--- a/adb/transport_local.c
+++ b/adb/transport_local.c
@@ -76,7 +76,7 @@ static int remote_read(apacket *p, atransport *t)
}
if(check_data(p)) {
- D("bad data: terminated (data)\n");
+ D("bad data: terminated (data)\n");
return -1;
}
@@ -107,15 +107,16 @@ int local_connect(int port)
char buf[64];
int fd = -1;
- fd = socket_loopback_client(port, SOCK_STREAM);
#if ADB_HOST
- if(fd < 0) {
- const char *host = getenv("ADBHOST");
- if(host) {
- fd = socket_network_client(host, port, SOCK_STREAM);
- }
+ const char *host = getenv("ADBHOST");
+ if (host) {
+ fd = socket_network_client(host, port, SOCK_STREAM);
}
#endif
+ if (fd < 0) {
+ fd = socket_loopback_client(port, SOCK_STREAM);
+ }
+
if (fd >= 0) {
D("client: connected on remote on fd %d\n", fd);
close_on_exec(fd);