From 02f1aec6e9a29196ac5e06962acfa01f38bc5260 Mon Sep 17 00:00:00 2001 From: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com> Date: Fri, 7 Nov 2025 00:11:02 +0800 Subject: [PATCH] ksud: Fix clippy --- userspace/ksud/src/ksucalls.rs | 1 - userspace/ksud/src/su.rs | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/userspace/ksud/src/ksucalls.rs b/userspace/ksud/src/ksucalls.rs index da4a1e67..acabf09a 100644 --- a/userspace/ksud/src/ksucalls.rs +++ b/userspace/ksud/src/ksucalls.rs @@ -1,5 +1,4 @@ use std::fs; -use std::os::fd::OwnedFd; #[cfg(any(target_os = "linux", target_os = "android"))] use std::os::fd::RawFd; use std::sync::OnceLock; diff --git a/userspace/ksud/src/su.rs b/userspace/ksud/src/su.rs index 6c3095b8..6afda762 100644 --- a/userspace/ksud/src/su.rs +++ b/userspace/ksud/src/su.rs @@ -6,8 +6,6 @@ use anyhow::{Context, Ok, Result, bail}; use getopts::Options; use libc::c_int; use log::{debug, error, info}; -use procfs::process::FDTarget::Path; -use std::fs::File; #[cfg(unix)] use std::os::unix::process::CommandExt; use std::{env, ffi::CStr, path::PathBuf, process::Command}; @@ -68,7 +66,7 @@ fn set_identity(uid: u32, gid: u32, groups: &[u32]) { } } -#[cfg(any(target_os = "android"))] +#[cfg(target_os = "android")] fn wrap_tty(fd: c_int) { let inner_fn = move || -> Result<()> { if unsafe { libc::isatty(fd) != 1 } { @@ -299,7 +297,7 @@ pub fn root_shell() -> Result<()> { let _ = utils::switch_mnt_ns(1); } - #[cfg(any(target_os = "android"))] + #[cfg(target_os = "android")] if use_fd_wrapper { wrap_tty(0); wrap_tty(1);