Merge "adbd: properly close subprocess pipes on Ctrl+C."
This commit is contained in:
commit
605628d325
1 changed files with 7 additions and 1 deletions
|
|
@ -477,8 +477,14 @@ void Subprocess::PassDataStreams() {
|
||||||
// and only fall back on this for unexpected closures.
|
// and only fall back on this for unexpected closures.
|
||||||
D("protocol FD died, sending SIGHUP to pid %d", pid_);
|
D("protocol FD died, sending SIGHUP to pid %d", pid_);
|
||||||
kill(pid_, SIGHUP);
|
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…
Add table
Reference in a new issue