Skip to content

Commit b2a1ae6

Browse files
tiannpershoot
authored andcommitted
Fix ksud build (tiann/KernelSU#2841)
1 parent 98c3285 commit b2a1ae6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

userspace/ksud_magic/src/ksucalls.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::fs;
2+
#[cfg(any(target_os = "linux", target_os = "android"))]
23
use std::os::unix::io::RawFd;
34
use std::sync::OnceLock;
45

@@ -39,7 +40,9 @@ struct CheckSafemodeCmd {
3940
}
4041

4142
// Global driver fd cache
43+
#[cfg(any(target_os = "linux", target_os = "android"))]
4244
static DRIVER_FD: OnceLock<RawFd> = OnceLock::new();
45+
#[cfg(any(target_os = "linux", target_os = "android"))]
4346
static INFO_CACHE: OnceLock<GetInfoCmd> = OnceLock::new();
4447

4548
const KSU_INSTALL_MAGIC1: u32 = 0xDEADBEEF;

userspace/ksud_overlayfs/src/ksucalls.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::fs;
2+
#[cfg(any(target_os = "linux", target_os = "android"))]
23
use std::os::unix::io::RawFd;
34
use std::sync::OnceLock;
45

@@ -39,7 +40,9 @@ struct CheckSafemodeCmd {
3940
}
4041

4142
// Global driver fd cache
43+
#[cfg(any(target_os = "linux", target_os = "android"))]
4244
static DRIVER_FD: OnceLock<RawFd> = OnceLock::new();
45+
#[cfg(any(target_os = "linux", target_os = "android"))]
4346
static INFO_CACHE: OnceLock<GetInfoCmd> = OnceLock::new();
4447

4548
const KSU_INSTALL_MAGIC1: u32 = 0xDEADBEEF;

0 commit comments

Comments
 (0)