diff --git a/native/jni/daemon/bootstages.c b/native/jni/daemon/bootstages.c index 8fa6feebf..e0a9d390e 100644 --- a/native/jni/daemon/bootstages.c +++ b/native/jni/daemon/bootstages.c @@ -190,6 +190,16 @@ static void exec_module_script(const char* stage) { * Magic Mount * ***************/ +static int bind_mount(const char *from, const char *to) { + int ret = xmount(from, to, NULL, MS_BIND, NULL); +#ifdef MAGISK_DEBUG + LOGI("bind_mount: %s <- %s\n", to, from); +#else + LOGI("bind_mount: %s\n", to); +#endif + return ret; +} + static void construct_tree(const char *module, struct node_entry *parent) { DIR *dir; struct dirent *entry; diff --git a/native/jni/utils/include/utils.h b/native/jni/utils/include/utils.h index 1b7070eff..36e795523 100644 --- a/native/jni/utils/include/utils.h +++ b/native/jni/utils/include/utils.h @@ -90,7 +90,6 @@ int is_num(const char *s); int exec_array(int err, int *fd, void (*setenv)(struct vector *), char *const *argv); int exec_command(int err, int *fd, void (*setenv)(struct vector*), const char *argv0, ...); int exec_command_sync(char *const argv0, ...); -int bind_mount(const char *from, const char *to); int switch_mnt_ns(int pid); int fork_dont_care(); void wait_till_exists(const char *target); diff --git a/native/jni/utils/misc.c b/native/jni/utils/misc.c index 328371fb8..4c79908ec 100644 --- a/native/jni/utils/misc.c +++ b/native/jni/utils/misc.c @@ -22,7 +22,6 @@ #include "logging.h" #include "utils.h" -#include "flags.h" unsigned get_shell_uid() { struct passwd* ppwd = getpwnam("shell"); @@ -198,16 +197,6 @@ int exec_command(int err, int *fd, void (*setenv)(struct vector*), const char *a return pid; } -int bind_mount(const char *from, const char *to) { - int ret = xmount(from, to, NULL, MS_BIND, NULL); -#ifdef MAGISK_DEBUG - LOGI("bind_mount: %s <- %s\n", to, from); -#else - LOGI("bind_mount: %s\n", to); -#endif - return ret; -} - int switch_mnt_ns(int pid) { char mnt[32]; snprintf(mnt, sizeof(mnt), "/proc/%d/ns/mnt", pid);