Fix typos

This commit is contained in:
topjohnwu 2024-03-31 14:17:25 -07:00
parent 2051836a73
commit 30bf5c8448
2 changed files with 8 additions and 8 deletions

View File

@ -24,6 +24,7 @@ pub fn setup_mounts() {
let dev_path = FsPathBuf::new(&mut dev_buf)
.join(magisk_tmp)
.join(PREINITDEV);
let mut mounted = false;
if let Ok(attr) = dev_path.get_attr() {
if attr.st.st_mode & libc::S_IFMT as c_uint == libc::S_IFBLK.as_() {
// DO NOT mount the block device directly, as we do not know the flags and configs
@ -33,7 +34,6 @@ pub fn setup_mounts() {
// mount point mounting our desired partition, and then bind mount the target folder.
let preinit_dev = attr.st.st_rdev;
let mnt_path = FsPathBuf::new(&mut buf).join(magisk_tmp).join(PREINITMIRR);
let mut mounted = false;
for info in parse_mount_info("self") {
if info.root == "/" && info.device == preinit_dev {
if !info.fs_option.split(',').any(|s| s == "rw") {
@ -64,14 +64,14 @@ pub fn setup_mounts() {
}
}
}
}
}
if !mounted {
warn!("mount: preinit mirror not mounted");
dev_path.remove().ok();
} else {
debug!("mount: preinit mirror mounted");
}
}
}
// Bind remount module root to clear nosuid
let module_mnt = FsPathBuf::new(&mut buf).join(magisk_tmp).join(MODULEMNT);

View File

@ -4,7 +4,7 @@ pub const LOGFILE: &str = "/cache/magisk.log";
// data paths
const SECURE_DIR: &str = "/data/adb";
pub const MODULEROOT: &str = concatcp!(SECURE_DIR, "modules");
pub const MODULEROOT: &str = concatcp!(SECURE_DIR, "/modules");
// tmpfs paths
const INTERNAL_DIR: &str = ".magisk";