You've already forked KernelSU-Next
mirror of
https://github.com/KernelSU-Next/KernelSU-Next.git
synced 2025-08-27 23:46:34 +00:00
ksud: make compiler happy
This commit is contained in:
@@ -247,6 +247,7 @@ pub struct StockMount {
|
|||||||
mnt: String,
|
mnt: String,
|
||||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||||
mountlist: Vec<(proc_mounts::MountInfo, std::path::PathBuf)>,
|
mountlist: Vec<(proc_mounts::MountInfo, std::path::PathBuf)>,
|
||||||
|
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||||
rootmount: sys_mount::Mount,
|
rootmount: sys_mount::Mount,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,11 +262,11 @@ impl StockMount {
|
|||||||
mounts.sort_by(|a, b| b.dest.cmp(&a.dest)); // inverse order
|
mounts.sort_by(|a, b| b.dest.cmp(&a.dest)); // inverse order
|
||||||
|
|
||||||
let mntroot = std::path::Path::new(crate::defs::STOCK_MNT_ROOT);
|
let mntroot = std::path::Path::new(crate::defs::STOCK_MNT_ROOT);
|
||||||
utils::ensure_dir_exists(&mntroot)?;
|
utils::ensure_dir_exists(mntroot)?;
|
||||||
log::info!("stock mount root: {}", mntroot.display());
|
log::info!("stock mount root: {}", mntroot.display());
|
||||||
|
|
||||||
let rootdir = mntroot.join(
|
let rootdir = mntroot.join(
|
||||||
mnt.strip_prefix("/")
|
mnt.strip_prefix('/')
|
||||||
.ok_or(anyhow::anyhow!("invalid mnt: {}!", mnt))?,
|
.ok_or(anyhow::anyhow!("invalid mnt: {}!", mnt))?,
|
||||||
);
|
);
|
||||||
utils::ensure_dir_exists(&rootdir)?;
|
utils::ensure_dir_exists(&rootdir)?;
|
||||||
@@ -290,7 +291,7 @@ impl StockMount {
|
|||||||
log::info!("bind stock mount: {} -> {}", dest.display(), path.display());
|
log::info!("bind stock mount: {} -> {}", dest.display(), path.display());
|
||||||
Mount::builder()
|
Mount::builder()
|
||||||
.flags(MountFlags::BIND)
|
.flags(MountFlags::BIND)
|
||||||
.mount(&dest, &path)?;
|
.mount(dest, &path)?;
|
||||||
|
|
||||||
ms.push((m.clone(), path));
|
ms.push((m.clone(), path));
|
||||||
}
|
}
|
||||||
@@ -315,7 +316,7 @@ impl StockMount {
|
|||||||
.mount(&src, &dst);
|
.mount(&src, &dst);
|
||||||
if let Err(e) = mount_result {
|
if let Err(e) = mount_result {
|
||||||
log::error!("remount failed: {}", e);
|
log::error!("remount failed: {}", e);
|
||||||
result = Err(e);
|
result = Err(e.into());
|
||||||
} else {
|
} else {
|
||||||
log::info!(
|
log::info!(
|
||||||
"remount {}({}) -> {} succeed!",
|
"remount {}({}) -> {} succeed!",
|
||||||
|
|||||||
Reference in New Issue
Block a user