dumpsys: switch to using a pipe to work around selinux denial.
Some services can't write to the socket that we were passing in, due to
selinux policies. Use a pipe for now.
Bug: http://b/27500248
Change-Id: Ic681121597a1717d31ef356bd6fe2c2daaa86d94
diff --git a/cmds/dumpsys/dumpsys.cpp b/cmds/dumpsys/dumpsys.cpp
index 46fb81a..003fcc3 100644
--- a/cmds/dumpsys/dumpsys.cpp
+++ b/cmds/dumpsys/dumpsys.cpp
@@ -141,9 +141,8 @@
if (service != NULL) {
int sfd[2];
- // Use a socketpair instead of a pipe to avoid sending SIGPIPE to services that timeout.
- if (socketpair(AF_UNIX, SOCK_STREAM, 0, sfd) != 0) {
- aerr << "Failed to create socketpair to dump service info for " << service_name
+ if (pipe(sfd) != 0) {
+ aerr << "Failed to create pipe to dump service info for " << service_name
<< ": " << strerror(errno) << endl;
continue;
}