summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Goby2012-06-12 14:12:18 -0500
committerBenoit Goby2012-06-12 18:14:58 -0500
commitaeceb5174502659cb4fff6de924b54ef7e6cdae7 (patch)
treeebdf729b2d0104e279a3376cfb90759ba4dc85f6
parent0f3974c3d0ee2ffe5e0cb9a56658ba18d511f6ea (diff)
downloadplatform-system-core-aeceb5174502659cb4fff6de924b54ef7e6cdae7.tar.gz
platform-system-core-aeceb5174502659cb4fff6de924b54ef7e6cdae7.tar.xz
platform-system-core-aeceb5174502659cb4fff6de924b54ef7e6cdae7.zip
adb: Fix adb tcpip commandandroid-cts-4.1_r1
When running "adb tcpip 5555", adb create a service socket named "tcpip:5555". Only compare the 6 first chars "tcpip:" to decide if we enable exit_on_close. Bug: 6650130 Change-Id: I0835973de044f1cfde0e859ff0277c0ccc2630a3
-rw-r--r--adb/sockets.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/adb/sockets.c b/adb/sockets.c
index 91db95164..cd31b23db 100644
--- a/adb/sockets.c
+++ b/adb/sockets.c
@@ -427,9 +427,9 @@ asocket *create_local_service_socket(const char *name)
427 D("LS(%d): bound to '%s' via %d\n", s->id, name, fd); 427 D("LS(%d): bound to '%s' via %d\n", s->id, name, fd);
428 428
429#if !ADB_HOST 429#if !ADB_HOST
430 if ((!strcmp(name, "root:") && getuid() != 0) 430 if ((!strncmp(name, "root:", 5) && getuid() != 0)
431 || !strcmp(name, "usb:") 431 || !strncmp(name, "usb:", 4)
432 || !strcmp(name, "tcpip:")) { 432 || !strncmp(name, "tcpip:", 6)) {
433 D("LS(%d): enabling exit_on_close\n", s->id); 433 D("LS(%d): enabling exit_on_close\n", s->id);
434 s->exit_on_close = 1; 434 s->exit_on_close = 1;
435 } 435 }