adbd: properly close subprocess pipes on Ctrl+C.
am: a6d5661140

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

Change-Id: I96c1fb2036a58702b23f606bb1e6a27f924324eb
diff --git a/adb/shell_service.cpp b/adb/shell_service.cpp
index ce10708..f58af9f 100644
--- a/adb/shell_service.cpp
+++ b/adb/shell_service.cpp
@@ -479,6 +479,12 @@
                 // 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();
         }