Move daemon utilities from base to core

Move utilities that are exclusively used by the daemon (core module)
from base to core:
- fork_dont_care, fork_no_orphan, new_daemon_thread, init_argv0,
  set_nice_name, and switch_mnt_ns into utils.cpp
- exec_command* functions and exec_t into scripting.cpp as static
  functions, as scripting is their sole consumer

Also remove the unused exec_command_sync overload.

Assisted-by: Gemini 3.8 Flash
This commit is contained in:
topjohnwu
2026-10-02 17:17:48 -07:00
parent 93708e5e73
commit b76d674a60
12 changed files with 183 additions and 188 deletions
+3 -2
View File
@@ -5,7 +5,8 @@ use crate::consts::{
};
use crate::db::Sqlite3;
use crate::ffi::{
ModuleInfo, RequestCode, RespondCode, denylist_handler, get_magisk_tmp, scan_deny_apps,
ModuleInfo, RequestCode, RespondCode, denylist_handler, fork_dont_care, get_magisk_tmp,
scan_deny_apps, set_nice_name,
};
use crate::logging::{android_logging, magisk_logging, setup_logfile, start_log_daemon};
use crate::module::remove_modules;
@@ -19,7 +20,7 @@ use crate::zygisk::ZygiskState;
use base::const_format::concatcp;
use base::{
AtomicArc, BufReadExt, FileAttr, FsPathBuilder, LoggedResult, ReadExt, ResultExt, Utf8CStr,
Utf8CStrBuf, WriteExt, cstr, fork_dont_care, info, libc, log_err, set_nice_name,
Utf8CStrBuf, WriteExt, cstr, info, libc, log_err,
};
use nix::fcntl::OFlag;
use nix::mount::MsFlags;