summaryrefslogtreecommitdiffstats
path: root/cmds/dumpstate/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmds/dumpstate/utils.c')
-rw-r--r--cmds/dumpstate/utils.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmds/dumpstate/utils.c b/cmds/dumpstate/utils.c
index c7a78cc..b2f9e80 100644
--- a/cmds/dumpstate/utils.c
+++ b/cmds/dumpstate/utils.c
@@ -167,6 +167,7 @@ int run_command(const char *title, int timeout_seconds, const char *command, ...
execvp(command, (char**) args);
printf("*** exec(%s): %s\n", command, strerror(errno));
+ fflush(stdout);
_exit(-1);
}
@@ -178,7 +179,7 @@ int run_command(const char *title, int timeout_seconds, const char *command, ...
if (p == pid) {
if (WIFSIGNALED(status)) {
printf("*** %s: Killed by signal %d\n", command, WTERMSIG(status));
- } else if (WEXITSTATUS(status) > 0) {
+ } else if (WIFEXITED(status) && WEXITSTATUS(status) > 0) {
printf("*** %s: Exit code %d\n", command, WEXITSTATUS(status));
}
if (title) printf("[%s: %.1fs elapsed]\n\n", command, elapsed);
@@ -429,3 +430,7 @@ const char *dump_vm_traces() {
rename(anr_traces_path, traces_path);
return dump_traces_path;
}
+
+void play_sound(const char* path) {
+ run_command(NULL, 5, "/system/bin/stagefright", "-o", "-a", path, NULL);
+}