summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorJP Abgrall <jpa@google.com>2012-05-11 14:14:09 -0700
committerJP Abgrall <jpa@google.com>2012-05-11 14:14:09 -0700
commit3e03d3fb6a4cb93f5f978f9d2eed7b7cc62a06a6 (patch)
treea8dca382de53cd551e3271fd8a2d8ef2f6bde77a /cmds
parentf30fd01497a53cbff8692721026c3f7b6830158e (diff)
downloadframeworks_native-3e03d3fb6a4cb93f5f978f9d2eed7b7cc62a06a6.zip
frameworks_native-3e03d3fb6a4cb93f5f978f9d2eed7b7cc62a06a6.tar.gz
frameworks_native-3e03d3fb6a4cb93f5f978f9d2eed7b7cc62a06a6.tar.bz2
Ignore SIGPIPE is some of the tools used via bugreport
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: I25b30a823addcff89d252f162d0a07035d4fdd3f
Diffstat (limited to 'cmds')
-rw-r--r--cmds/dumpstate/dumpstate.c2
-rw-r--r--cmds/dumpsys/dumpsys.cpp1
2 files changed, 3 insertions, 0 deletions
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c
index dd015c6..880f81f 100644
--- a/cmds/dumpstate/dumpstate.c
+++ b/cmds/dumpstate/dumpstate.c
@@ -311,6 +311,8 @@ int main(int argc, char *argv[]) {
ALOGI("begin\n");
+ signal(SIGPIPE, SIG_IGN);
+
/* set as high priority, and protect from OOM killer */
setpriority(PRIO_PROCESS, 0, -20);
FILE *oom_adj = fopen("/proc/self/oom_adj", "w");
diff --git a/cmds/dumpsys/dumpsys.cpp b/cmds/dumpsys/dumpsys.cpp
index 7dad6b6..c9fcc00 100644
--- a/cmds/dumpsys/dumpsys.cpp
+++ b/cmds/dumpsys/dumpsys.cpp
@@ -28,6 +28,7 @@ static int sort_func(const String16* lhs, const String16* rhs)
int main(int argc, char* const argv[])
{
+ signal(SIGPIPE, SIG_IGN);
sp<IServiceManager> sm = defaultServiceManager();
fflush(stdout);
if (sm == NULL) {