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

Commit 5701c582 authored by David Pursell's avatar David Pursell Committed by android-build-merger
Browse files

Merge "adbd: properly close subprocess pipes on Ctrl+C."

am: 605628d3

* commit '605628d3':
  adbd: properly close subprocess pipes on Ctrl+C.

Change-Id: I6eb8faa339a0a6506e21d5c74e5e9b8582e04735
parents ee915afa 605628d3
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -477,8 +477,14 @@ void Subprocess::PassDataStreams() {
                // and only fall back on this for unexpected closures.
                D("protocol FD died, sending SIGHUP to pid %d", pid_);
                kill(pid_, SIGHUP);

                // We also need to close the pipes connected to the child process
                // so that if it ignores SIGHUP and continues to write data it
                // won't fill up the pipe and block.
                stdinout_sfd_.clear();
                stderr_sfd_.clear();
            }
            dead_sfd->reset(-1);
            dead_sfd->clear();
        }
    }
}