mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-05 11:30:47 -05:00
Make FsPathBuf a trait and rename to FsPathBuilder
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
use crate::ffi::MagiskInit;
|
||||
use base::libc::{TMPFS_MAGIC, statfs};
|
||||
use base::{
|
||||
Directory, FsPath, FsPathBuf, FsPathMnt, LibcReturn, LoggedResult, ResultExt, Utf8CStr, cstr,
|
||||
debug, libc,
|
||||
Directory, FsPath, FsPathBuilder, FsPathMnt, LibcReturn, LoggedResult, ResultExt, Utf8CStr,
|
||||
cstr, cstr_buf, debug, libc,
|
||||
libc::{chdir, chroot, execve, exit, mount},
|
||||
parse_mount_info, raw_cstr,
|
||||
};
|
||||
@@ -38,9 +38,9 @@ pub(crate) fn switch_root(path: &Utf8CStr) {
|
||||
|
||||
let mut target = info.target.clone();
|
||||
let target = Utf8CStr::from_string(&mut target);
|
||||
let new_path = FsPathBuf::default()
|
||||
.join(path)
|
||||
.join(info.target.trim_start_matches('/'));
|
||||
let new_path = cstr_buf::default()
|
||||
.join_path(path)
|
||||
.join_path(info.target.trim_start_matches('/'));
|
||||
new_path.mkdirs(0o755).ok();
|
||||
target.move_mount_to(&new_path)?;
|
||||
mounts.insert(info.target);
|
||||
|
||||
Reference in New Issue
Block a user