summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2016-05-18 10:39:48 -0700
committergitbuildkicker <android-build@google.com>2016-07-21 17:35:58 -0700
commitf483354e592c9edd836acbc0fffcedfb6958c889 (patch)
tree3814541d384a029fef2161323eb73943846f0896
parent014b1592fd10ef5733a943325cf20cb6c1cdf187 (diff)
downloadsystem_core-f483354e592c9edd836acbc0fffcedfb6958c889.tar.gz
system_core-f483354e592c9edd836acbc0fffcedfb6958c889.tar.bz2
system_core-f483354e592c9edd836acbc0fffcedfb6958c889.zip
adb: use asocket's close function when closing.
close_all_sockets was assuming that all registered local sockets used local_socket_close as their close function. However, this is not true for JDWP sockets. Bug: http://b/28347842 Change-Id: I40a1174845cd33f15f30ce70828a7081cd5a087e (cherry picked from commit 53eb31d87cb84a4212f4850bf745646e1fb12814) (cherry picked from commit 014b01706cc64dc9c2ad94a96f62e07c058d0b5d)
-rw-r--r--adb/sockets.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/adb/sockets.cpp b/adb/sockets.cpp
index 31b54431b..3919147a3 100644
--- a/adb/sockets.cpp
+++ b/adb/sockets.cpp
@@ -43,8 +43,6 @@
using std::recursive_mutex;
#endif
-static void local_socket_close(asocket* s);
-
static recursive_mutex& local_socket_list_lock = *new recursive_mutex();
static unsigned local_socket_next_id = 1;
@@ -128,7 +126,7 @@ void close_all_sockets(atransport *t)
restart:
for (s = local_socket_list.next; s != &local_socket_list; s = s->next) {
if (s->transport == t || (s->peer && s->peer->transport == t)) {
- local_socket_close(s);
+ s->close(s);
goto restart;
}
}