summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJP Abgrall <jpa@google.com>2012-05-11 14:09:59 -0700
committerJP Abgrall <jpa@google.com>2012-05-11 14:09:59 -0700
commit80cb15504324667c9934ff350afff48881613393 (patch)
tree03d15e68bd56e456b89d082b65260c0c3b3b59eb
parent585c219b9b7c2e89b8db6707cacdaf29c362e7ba (diff)
downloadextras-80cb15504324667c9934ff350afff48881613393.tar.gz
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
-rw-r--r--librank/librank.c1
-rw-r--r--procrank/procrank.c1
-rw-r--r--showmap/showmap.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/librank/librank.c b/librank/librank.c
index 13b20974..e54d1c34 100644
--- a/librank/librank.c
+++ b/librank/librank.c
@@ -184,6 +184,7 @@ int main(int argc, char *argv[]) {
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 28d6f251..061f40f4 100644
--- a/procrank/procrank.c
+++ b/procrank/procrank.c
@@ -133,6 +133,7 @@ int main(int argc, char *argv[]) {
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 bb359f65..f8ee9358 100644
--- a/showmap/showmap.c
+++ b/showmap/showmap.c
@@ -321,6 +321,7 @@ int main(int argc, char *argv[])
char *arg;
char *argend;
+ signal(SIGPIPE, SIG_IGN);
for (argc--, argv++; argc > 0; argc--, argv++) {
arg = argv[0];
if (!strcmp(arg,"-v")) {