Loading cmds/dumpstate/dumpstate.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -200,7 +200,7 @@ static void dump_systrace() { execl("/system/bin/atrace", "/system/bin/atrace", "--async_dump", nullptr); execl("/system/bin/atrace", "/system/bin/atrace", "--async_dump", nullptr); // execl should never return, but it doesn't hurt to handle that scenario // execl should never return, but it doesn't hurt to handle that scenario MYLOGD("execl on '/system/bin/atrace --async_dump' returned control"); MYLOGD("execl on '/system/bin/atrace --async_dump' returned control"); _exit(-1); return; } else { } else { close(pipefd[1]); // close the write end of the pipe in the parent close(pipefd[1]); // close the write end of the pipe in the parent add_zip_entry_from_fd("systrace.txt", pipefd[0]); // write output to zip file add_zip_entry_from_fd("systrace.txt", pipefd[0]); // write output to zip file Loading cmds/dumpstate/utils.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -724,7 +724,7 @@ int run_command_always(const char *title, bool drop_root, int timeout_seconds, c if (pid == 0) { if (pid == 0) { if (drop_root && !drop_root_user()) { if (drop_root && !drop_root_user()) { printf("*** could not drop root before running %s: %s\n", command, strerror(errno)); printf("*** could not drop root before running %s: %s\n", command, strerror(errno)); _exit(-1); return -1; } } /* make sure the child dies when dumpstate dies */ /* make sure the child dies when dumpstate dies */ Loading @@ -740,7 +740,7 @@ int run_command_always(const char *title, bool drop_root, int timeout_seconds, c // execvp's result will be handled after waitpid_with_timeout() below... // execvp's result will be handled after waitpid_with_timeout() below... MYLOGD("execvp on command %s returned control (error: %s)", command, strerror(errno)); MYLOGD("execvp on command %s returned control (error: %s)", command, strerror(errno)); fflush(stdout); fflush(stdout); _exit(-1); // ...but it doesn't hurt to force exit, just in case return -1; // ...but it doesn't hurt to force exit, just in case } } /* handle parent case */ /* handle parent case */ Loading Loading @@ -852,7 +852,7 @@ void send_broadcast(const std::string& action, const std::vector<std::string>& a std::string args_string; std::string args_string; format_args(am_index + 1, am_args, &args_string); format_args(am_index + 1, am_args, &args_string); MYLOGD("send_broadcast command: %s\n", args_string.c_str()); MYLOGD("send_broadcast command: %s\n", args_string.c_str()); run_command_always(NULL, 20, true, am_args); run_command_always(NULL, true, 20, am_args); } } size_t num_props = 0; size_t num_props = 0; Loading Loading
cmds/dumpstate/dumpstate.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -200,7 +200,7 @@ static void dump_systrace() { execl("/system/bin/atrace", "/system/bin/atrace", "--async_dump", nullptr); execl("/system/bin/atrace", "/system/bin/atrace", "--async_dump", nullptr); // execl should never return, but it doesn't hurt to handle that scenario // execl should never return, but it doesn't hurt to handle that scenario MYLOGD("execl on '/system/bin/atrace --async_dump' returned control"); MYLOGD("execl on '/system/bin/atrace --async_dump' returned control"); _exit(-1); return; } else { } else { close(pipefd[1]); // close the write end of the pipe in the parent close(pipefd[1]); // close the write end of the pipe in the parent add_zip_entry_from_fd("systrace.txt", pipefd[0]); // write output to zip file add_zip_entry_from_fd("systrace.txt", pipefd[0]); // write output to zip file Loading
cmds/dumpstate/utils.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -724,7 +724,7 @@ int run_command_always(const char *title, bool drop_root, int timeout_seconds, c if (pid == 0) { if (pid == 0) { if (drop_root && !drop_root_user()) { if (drop_root && !drop_root_user()) { printf("*** could not drop root before running %s: %s\n", command, strerror(errno)); printf("*** could not drop root before running %s: %s\n", command, strerror(errno)); _exit(-1); return -1; } } /* make sure the child dies when dumpstate dies */ /* make sure the child dies when dumpstate dies */ Loading @@ -740,7 +740,7 @@ int run_command_always(const char *title, bool drop_root, int timeout_seconds, c // execvp's result will be handled after waitpid_with_timeout() below... // execvp's result will be handled after waitpid_with_timeout() below... MYLOGD("execvp on command %s returned control (error: %s)", command, strerror(errno)); MYLOGD("execvp on command %s returned control (error: %s)", command, strerror(errno)); fflush(stdout); fflush(stdout); _exit(-1); // ...but it doesn't hurt to force exit, just in case return -1; // ...but it doesn't hurt to force exit, just in case } } /* handle parent case */ /* handle parent case */ Loading Loading @@ -852,7 +852,7 @@ void send_broadcast(const std::string& action, const std::vector<std::string>& a std::string args_string; std::string args_string; format_args(am_index + 1, am_args, &args_string); format_args(am_index + 1, am_args, &args_string); MYLOGD("send_broadcast command: %s\n", args_string.c_str()); MYLOGD("send_broadcast command: %s\n", args_string.c_str()); run_command_always(NULL, 20, true, am_args); run_command_always(NULL, true, 20, am_args); } } size_t num_props = 0; size_t num_props = 0; Loading