Merge "adbd: properly close subprocess pipes on Ctrl+C." am: 605628d325
am: 5701c58296
* commit '5701c58296b7ae84e8b9e67b6103ffdf63550fc7':
adbd: properly close subprocess pipes on Ctrl+C.
Change-Id: I361b9ed8ce1d12487d88850635bf1b60c1b675c4
This commit is contained in:
commit
27a68ef007
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue