Ignore SIGPIPE is some of the tools used via dumpstate
adb bugreport > b & sleep 5; kill $?
will show that a bunch of tools will SIGPIPE when trying to output data
which is normal.
We don't have a way on linux (bsd yes), to set NOSIGPIPE on the file desc
passed down via fork/exec.
Bug: 6447319
Change-Id: I1634a00a155fd8a3fd827aa4a77e94518534336c
diff --git a/librank/librank.c b/librank/librank.c
index 13b2097..e54d1c3 100644
--- a/librank/librank.c
+++ b/librank/librank.c
@@ -184,6 +184,7 @@
int i, j, error;
+ signal(SIGPIPE, SIG_IGN);
compfn = &sort_by_pss;
order = -1;
prefix = NULL;
diff --git a/procrank/procrank.c b/procrank/procrank.c
index 28d6f25..061f40f 100644
--- a/procrank/procrank.c
+++ b/procrank/procrank.c
@@ -133,6 +133,7 @@
int arg;
size_t i, j;
+ signal(SIGPIPE, SIG_IGN);
compfn = &sort_by_pss;
order = -1;
ws = WS_OFF;
diff --git a/showmap/showmap.c b/showmap/showmap.c
index bb359f6..f8ee935 100644
--- a/showmap/showmap.c
+++ b/showmap/showmap.c
@@ -321,6 +321,7 @@
char *arg;
char *argend;
+ signal(SIGPIPE, SIG_IGN);
for (argc--, argv++; argc > 0; argc--, argv++) {
arg = argv[0];
if (!strcmp(arg,"-v")) {