Skip to content
Snippets Groups Projects
Commit 014b0170 authored by Josh Gao's avatar Josh Gao
Browse files

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 53eb31d8)
parent 268068f2
Branches
Tags
No related merge requests found
......@@ -39,8 +39,6 @@
#include "sysdeps/mutex.h"
#include "transport.h"
static void local_socket_close(asocket* s);
static std::recursive_mutex& local_socket_list_lock = *new std::recursive_mutex();
static unsigned local_socket_next_id = 1;
......@@ -118,7 +116,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;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment