Merge "adbd: fix spurious close of uninitialized fd."

am: 3c608c7425

* commit '3c608c7425f9201c7e673d2f47bb4e1ffe93d216':
  adbd: fix spurious close of uninitialized fd.
This commit is contained in:
Josh Gao 2016-03-05 03:08:34 +00:00 committed by android-build-merger
commit 97b9935fba

View file

@ -315,7 +315,9 @@ bool Subprocess::ForkAndExec(std::string* error) {
if (type_ == SubprocessType::kPty) {
int fd;
pid_ = forkpty(&fd, pts_name, nullptr, nullptr);
stdinout_sfd_.Reset(fd);
if (pid_ > 0) {
stdinout_sfd_.Reset(fd);
}
} else {
if (!CreateSocketpair(&stdinout_sfd_, &child_stdinout_sfd)) {
*error = android::base::StringPrintf("failed to create socketpair for stdin/out: %s",