Refactor several utility functions

This commit is contained in:
topjohnwu
2017-08-20 21:36:32 +08:00
parent 1913125881
commit e3df62d812
7 changed files with 117 additions and 129 deletions

View File

@ -26,13 +26,11 @@ static void *logger_thread(void *args) {
while (1) {
// Start logcat
char *const command[] = { "logcat", "-s", "Magisk", "-v", "thread", NULL };
log_pid = run_command2(0, &log_fd, NULL, command);
log_pid = exec_command(0, &log_fd, NULL, "logcat", "-s", "Magisk", "-v", "thread", NULL);
if (log_pid > 0)
waitpid(log_pid, NULL, 0);
// For some reason it went here, clear buffer and restart
char *const restart[] = { "logcat", "-c", NULL };
run_command(restart);
exec_command_sync("logcat", "-c", NULL);
}
// Should never be here, but well...