Skip to content

Commit e309a03

Browse files
committed
ksud: Fix windows compile
1 parent 82a304e commit e309a03

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

Diff for: userspace/ksud/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ rust-embed = { version = "6.4.2", features = [
3131
"debug-embed",
3232
"compression", # must clean build after updating binaries
3333
] }
34-
proc-mounts = "0.3"
3534

3635
[target.'cfg(any(target_os = "android", target_os = "linux"))'.dependencies]
3736
sys-mount = { git = "https://github.com/tiann/sys-mount" }
3837
# some android specific dependencies which compiles under unix are also listed here for convenience of coding
3938
android-properties = { version = "0.2.2", features = ["bionic-deprecated"] }
4039
procfs = "0.15"
40+
proc-mounts = "0.3"
4141

4242
[target.'cfg(target_os = "android")'.dependencies]
4343
android_logger = "0.13"

Diff for: userspace/ksud/src/mount.rs

+21-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use anyhow::Result;
1+
use anyhow::{Ok, Result};
22

33
#[cfg(any(target_os = "linux", target_os = "android"))]
4-
use anyhow::{Context, Ok};
4+
use anyhow::Context;
55
#[cfg(any(target_os = "linux", target_os = "android"))]
66
use retry::delay::NoDelay;
77
#[cfg(any(target_os = "linux", target_os = "android"))]
@@ -260,9 +260,11 @@ impl StockOverlay {
260260
#[derive(Debug)]
261261
pub struct StockMount {
262262
mnt: String,
263+
#[cfg(any(target_os = "linux", target_os = "android"))]
263264
mountlist: proc_mounts::MountList,
264265
}
265266

267+
#[cfg(any(target_os = "linux", target_os = "android"))]
266268
impl StockMount {
267269
pub fn new(mnt: &str) -> Result<Self> {
268270
let mountlist = proc_mounts::MountList::new()?;
@@ -322,3 +324,20 @@ impl StockMount {
322324
Ok(())
323325
}
324326
}
327+
328+
#[cfg(not(any(target_os = "linux", target_os = "android")))]
329+
impl StockMount {
330+
pub fn new(mnt: &str) -> Result<Self> {
331+
Ok(Self {
332+
mnt: mnt.to_string(),
333+
})
334+
}
335+
336+
pub fn umount(&self) -> Result<()> {
337+
unimplemented!()
338+
}
339+
340+
pub fn remount(&self) -> Result<()> {
341+
unimplemented!()
342+
}
343+
}

0 commit comments

Comments
 (0)