Loading cmds/dumpstate/dumpstate.cpp +14 −9 Original line number Diff line number Diff line Loading @@ -270,7 +270,7 @@ static unsigned long logcat_timeout(const char *name) { /* End copy from system/core/logd/LogBuffer.cpp */ /* dumps the current system state to stdout */ static void dumpstate(std::string screenshot_path) { static void dumpstate(const std::string& screenshot_path) { unsigned long timeout; time_t now = time(NULL); char build[PROPERTY_VALUE_MAX], fingerprint[PROPERTY_VALUE_MAX]; Loading Loading @@ -815,7 +815,11 @@ int main(int argc, char *argv[]) { } } if (!screenshot_path.empty() && do_early_screenshot) { if (do_fb && do_early_screenshot) { if (screenshot_path.empty()) { // should not have happened ALOGE("INTERNAL ERROR: skipping early screenshot because path was not set"); } else { ALOGI("taking early screenshot\n"); take_screenshot(screenshot_path); ALOGI("wrote screenshot: %s\n", screenshot_path.c_str()); Loading @@ -824,6 +828,7 @@ int main(int argc, char *argv[]) { screenshot_path.c_str(), strerror(errno)); } } } /* read /proc/cmdline before dropping root */ FILE *cmdline = fopen("/proc/cmdline", "re"); Loading Loading @@ -884,7 +889,7 @@ int main(int argc, char *argv[]) { redirect_to_file(stdout, const_cast<char*>(tmp_path.c_str())); } dumpstate(do_early_screenshot ? NULL : screenshot_path); dumpstate(do_early_screenshot ? "": screenshot_path); /* done */ if (vibrator) { Loading cmds/dumpstate/dumpstate.h +1 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,7 @@ void play_sound(const char *path); void dumpstate_board(); /* Takes a screenshot and save it to the given file */ void take_screenshot(std::string path); void take_screenshot(const std::string& path); #ifdef __cplusplus } Loading cmds/dumpstate/utils.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -880,7 +880,7 @@ void update_progress(int delta) { } } void take_screenshot(std::string path) { void take_screenshot(const std::string& path) { const char *args[] = { "/system/bin/screencap", "-p", path.c_str(), NULL }; run_command_always(NULL, 10, args); } Loading
cmds/dumpstate/dumpstate.cpp +14 −9 Original line number Diff line number Diff line Loading @@ -270,7 +270,7 @@ static unsigned long logcat_timeout(const char *name) { /* End copy from system/core/logd/LogBuffer.cpp */ /* dumps the current system state to stdout */ static void dumpstate(std::string screenshot_path) { static void dumpstate(const std::string& screenshot_path) { unsigned long timeout; time_t now = time(NULL); char build[PROPERTY_VALUE_MAX], fingerprint[PROPERTY_VALUE_MAX]; Loading Loading @@ -815,7 +815,11 @@ int main(int argc, char *argv[]) { } } if (!screenshot_path.empty() && do_early_screenshot) { if (do_fb && do_early_screenshot) { if (screenshot_path.empty()) { // should not have happened ALOGE("INTERNAL ERROR: skipping early screenshot because path was not set"); } else { ALOGI("taking early screenshot\n"); take_screenshot(screenshot_path); ALOGI("wrote screenshot: %s\n", screenshot_path.c_str()); Loading @@ -824,6 +828,7 @@ int main(int argc, char *argv[]) { screenshot_path.c_str(), strerror(errno)); } } } /* read /proc/cmdline before dropping root */ FILE *cmdline = fopen("/proc/cmdline", "re"); Loading Loading @@ -884,7 +889,7 @@ int main(int argc, char *argv[]) { redirect_to_file(stdout, const_cast<char*>(tmp_path.c_str())); } dumpstate(do_early_screenshot ? NULL : screenshot_path); dumpstate(do_early_screenshot ? "": screenshot_path); /* done */ if (vibrator) { Loading
cmds/dumpstate/dumpstate.h +1 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,7 @@ void play_sound(const char *path); void dumpstate_board(); /* Takes a screenshot and save it to the given file */ void take_screenshot(std::string path); void take_screenshot(const std::string& path); #ifdef __cplusplus } Loading
cmds/dumpstate/utils.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -880,7 +880,7 @@ void update_progress(int delta) { } } void take_screenshot(std::string path) { void take_screenshot(const std::string& path) { const char *args[] = { "/system/bin/screencap", "-p", path.c_str(), NULL }; run_command_always(NULL, 10, args); }