Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08bd13eb authored by Josh Gao's avatar Josh Gao
Browse files

adb: win32: don't shutdown socket when closing.

This appears to be an attempt to do orderly shutdown, but it doesn't
wait until the socket becomes readable, so it doesn't actually work. We
implement orderly shutdown elsewhere already, so delete this so that we
don't accidentally shutdown a duped socket.

Test: wine adb_test
Change-Id: I35f8843e8e6dbc7886fd545f0e43375a005e160f
parent 2ad4c369
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -610,15 +610,6 @@ static void _fh_socket_init(FH f) {

static int _fh_socket_close(FH f) {
    if (f->fh_socket != INVALID_SOCKET) {
        /* gently tell any peer that we're closing the socket */
        if (shutdown(f->fh_socket, SD_BOTH) == SOCKET_ERROR) {
            // If the socket is not connected, this returns an error. We want to
            // minimize logging spam, so don't log these errors for now.
#if 0
            D("socket shutdown failed: %s",
              android::base::SystemErrorCodeToString(WSAGetLastError()).c_str());
#endif
        }
        if (closesocket(f->fh_socket) == SOCKET_ERROR) {
            // Don't set errno here, since adb_close will ignore it.
            const DWORD err = WSAGetLastError();