From 2f1e64dc1b4aba1b73b540556019219b797cf4e6 Mon Sep 17 00:00:00 2001 From: tiann Date: Tue, 11 Apr 2023 20:45:21 +0800 Subject: [PATCH] ksud: make compiler happy --- userspace/ksud/src/mount.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/userspace/ksud/src/mount.rs b/userspace/ksud/src/mount.rs index eca448d6..75a4b3a9 100644 --- a/userspace/ksud/src/mount.rs +++ b/userspace/ksud/src/mount.rs @@ -247,6 +247,7 @@ pub struct StockMount { mnt: String, #[cfg(any(target_os = "linux", target_os = "android"))] mountlist: Vec<(proc_mounts::MountInfo, std::path::PathBuf)>, + #[cfg(any(target_os = "linux", target_os = "android"))] rootmount: sys_mount::Mount, } @@ -261,11 +262,11 @@ impl StockMount { mounts.sort_by(|a, b| b.dest.cmp(&a.dest)); // inverse order 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()); let rootdir = mntroot.join( - mnt.strip_prefix("/") + mnt.strip_prefix('/') .ok_or(anyhow::anyhow!("invalid mnt: {}!", mnt))?, ); utils::ensure_dir_exists(&rootdir)?; @@ -290,7 +291,7 @@ impl StockMount { log::info!("bind stock mount: {} -> {}", dest.display(), path.display()); Mount::builder() .flags(MountFlags::BIND) - .mount(&dest, &path)?; + .mount(dest, &path)?; ms.push((m.clone(), path)); } @@ -315,7 +316,7 @@ impl StockMount { .mount(&src, &dst); if let Err(e) = mount_result { log::error!("remount failed: {}", e); - result = Err(e); + result = Err(e.into()); } else { log::info!( "remount {}({}) -> {} succeed!",