mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-03 13:52:10 +00:00
Update exec functions signatures
This commit is contained in:
@@ -317,7 +317,7 @@ static void exec_common_script(const char* stage) {
|
||||
if (access(entry->d_name, X_OK) == -1)
|
||||
continue;
|
||||
LOGI("%s.d: exec [%s]\n", stage, entry->d_name);
|
||||
int pid = exec_command(0, nullptr,
|
||||
int pid = exec_command(false, nullptr,
|
||||
strcmp(stage, "post-fs-data") ? set_path : set_mirror_path,
|
||||
"sh", entry->d_name, nullptr);
|
||||
if (pid != -1)
|
||||
@@ -336,8 +336,7 @@ static void exec_module_script(const char* stage) {
|
||||
if (access(buf2, F_OK) == -1 || access(buf, F_OK) == 0)
|
||||
continue;
|
||||
LOGI("%s: exec [%s.sh]\n", module, stage);
|
||||
int pid = exec_command(
|
||||
0, nullptr,
|
||||
int pid = exec_command(false, nullptr,
|
||||
strcmp(stage, "post-fs-data") ? set_path : set_mirror_path,
|
||||
"sh", buf2, nullptr);
|
||||
if (pid != -1)
|
||||
@@ -555,7 +554,7 @@ static void install_apk(const char *apk) {
|
||||
sleep(5);
|
||||
LOGD("apk_install: attempting to install APK");
|
||||
int apk_res = -1, pid;
|
||||
pid = exec_command(1, &apk_res, nullptr, "/system/bin/pm", "install", "-r", apk, nullptr);
|
||||
pid = exec_command(true, &apk_res, nullptr, "/system/bin/pm", "install", "-r", apk, nullptr);
|
||||
if (pid != -1) {
|
||||
int err = 0;
|
||||
while (fdgets(buf, PATH_MAX, apk_res) > 0) {
|
||||
|
||||
@@ -83,7 +83,7 @@ static void *logcat_thread(void *) {
|
||||
char line[4096];
|
||||
while (1) {
|
||||
// Start logcat
|
||||
log_pid = exec_array(0, &log_fd, nullptr, log_cmd.data());
|
||||
log_pid = exec_array(false, &log_fd, nullptr, log_cmd.data());
|
||||
FILE *logs = fdopen(log_fd, "r");
|
||||
while (fgets(line, sizeof(line), logs)) {
|
||||
if (line[0] == '-')
|
||||
@@ -104,7 +104,7 @@ static void *logcat_thread(void *) {
|
||||
|
||||
LOGI("magisklogd: logcat output EOF");
|
||||
// Clear buffer
|
||||
log_pid = exec_array(0, nullptr, nullptr, clear_cmd.data());
|
||||
log_pid = exec_array(false, nullptr, nullptr, clear_cmd.data());
|
||||
waitpid(log_pid, nullptr, 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user