Merge "adb: use asocket's close function when closing."
This commit is contained in:
commit
684d543922
1 changed files with 1 additions and 3 deletions
|
|
@ -39,8 +39,6 @@
|
||||||
#include "sysdeps/mutex.h"
|
#include "sysdeps/mutex.h"
|
||||||
#include "transport.h"
|
#include "transport.h"
|
||||||
|
|
||||||
static void local_socket_close(asocket* s);
|
|
||||||
|
|
||||||
static std::recursive_mutex& local_socket_list_lock = *new std::recursive_mutex();
|
static std::recursive_mutex& local_socket_list_lock = *new std::recursive_mutex();
|
||||||
static unsigned local_socket_next_id = 1;
|
static unsigned local_socket_next_id = 1;
|
||||||
|
|
||||||
|
|
@ -118,7 +116,7 @@ void close_all_sockets(atransport* t) {
|
||||||
restart:
|
restart:
|
||||||
for (s = local_socket_list.next; s != &local_socket_list; s = s->next) {
|
for (s = local_socket_list.next; s != &local_socket_list; s = s->next) {
|
||||||
if (s->transport == t || (s->peer && s->peer->transport == t)) {
|
if (s->transport == t || (s->peer && s->peer->transport == t)) {
|
||||||
local_socket_close(s);
|
s->close(s);
|
||||||
goto restart;
|
goto restart;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue