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

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

adbd: properly close subprocess pipes on Ctrl+C.

am: a6d56611

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

Change-Id: I96c1fb2036a58702b23f606bb1e6a27f924324eb
parents e780adf0 a6d56611
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -479,6 +479,12 @@ 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_.Reset();
                stderr_sfd_.Reset();
            }
            dead_sfd->Reset();
        }