summaryrefslogtreecommitdiffstats
path: root/cmds/dumpstate/utils.c
diff options
context:
space:
mode:
authorjp abgrall <jpa@google.com>2013-03-11 18:09:35 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-03-11 18:09:35 +0000
commitba8abb517d1eddebeda62bf907fa446e3c3b81f6 (patch)
treee0ab70f40b9dae2791fec8de3602d8bee86603c0 /cmds/dumpstate/utils.c
parentbfb2aa46529ebe4889940ff2e11e00d38b04aace (diff)
parente7b6cf13f94f66ea446c95ab34040b0a577e43dc (diff)
downloadframeworks_native-ba8abb517d1eddebeda62bf907fa446e3c3b81f6.zip
frameworks_native-ba8abb517d1eddebeda62bf907fa446e3c3b81f6.tar.gz
frameworks_native-ba8abb517d1eddebeda62bf907fa446e3c3b81f6.tar.bz2
Merge "Ensure dumpstate children die"
Diffstat (limited to 'cmds/dumpstate/utils.c')
-rw-r--r--cmds/dumpstate/utils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmds/dumpstate/utils.c b/cmds/dumpstate/utils.c
index 8f132d5..eaef3d4 100644
--- a/cmds/dumpstate/utils.c
+++ b/cmds/dumpstate/utils.c
@@ -31,6 +31,7 @@
#include <sys/klog.h>
#include <time.h>
#include <unistd.h>
+#include <sys/prctl.h>
#include <cutils/debugger.h>
#include <cutils/properties.h>
@@ -199,6 +200,9 @@ int run_command(const char *title, int timeout_seconds, const char *command, ...
const char *args[1024] = {command};
size_t arg;
+ /* make sure the child dies when dumpstate dies */
+ prctl(PR_SET_PDEATHSIG, SIGKILL);
+
va_list ap;
va_start(ap, command);
if (title) printf("------ %s (%s", title, command);