summaryrefslogtreecommitdiff
path: root/cmds/dumpstate/utils.c
diff options
context:
space:
mode:
author jp abgrall <jpa@google.com> 2013-03-11 19:34:13 +0000
committer Android Git Automerger <android-git-automerger@android.com> 2013-03-11 19:34:13 +0000
commit1e928f404f83da6ed29dc3d0b28f0a376b12d327 (patch)
tree797c4b3d81575250820a2bf59d97ad2086894eef /cmds/dumpstate/utils.c
parentb1beeb4ab90fa00c24ae853818e2b33f32da851b (diff)
parent574d6902b7e30a1e9c2375481549c8e8a712d6e6 (diff)
am 574d6902: am ba8abb51: Merge "Ensure dumpstate children die"
* commit '574d6902b7e30a1e9c2375481549c8e8a712d6e6': 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 fd390f5630..d081590df8 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>
@@ -264,6 +265,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);