Rewrite exec_command

This commit is contained in:
topjohnwu
2019-01-26 13:39:24 -05:00
parent 7565ea2787
commit d32b788988
5 changed files with 45 additions and 86 deletions
+2 -2
View File
@@ -134,7 +134,7 @@ static void log_daemon() {
// Test whether these buffers actually works
const char *b[] = { "main", "events", "crash" };
for (auto &buffer : b) {
if (exec_command_sync(MIRRDIR "/system/bin/logcat", "-b", buffer, "-d", "-f", "/dev/null", nullptr) == 0) {
if (exec_command_sync(MIRRDIR "/system/bin/logcat", "-b", buffer, "-d", "-f", "/dev/null") == 0) {
log_cmd.push_back("-b");
log_cmd.push_back(buffer);
}
@@ -183,7 +183,7 @@ static void log_daemon() {
bool start_log_daemon() {
if (!log_daemon_started) {
if (exec_command_sync(MIRRDIR "/system/bin/logcat", "-d", "-f", "/dev/null", nullptr) == 0) {
if (exec_command_sync(MIRRDIR "/system/bin/logcat", "-d", "-f", "/dev/null") == 0) {
if (fork_dont_care() == 0)
log_daemon();
log_daemon_started = true;