uucore: fix "X is never used" warnings on Redox

This commit is contained in:
Daniel Hofstetter 2024-02-02 09:33:35 +01:00
parent 4a7dfa7904
commit 9c7675945f
2 changed files with 5 additions and 5 deletions

View file

@ -124,7 +124,7 @@ pub fn get_groups_gnu(arg_id: Option<u32>) -> IOResult<Vec<gid_t>> {
Ok(sort_groups(groups, egid))
}
#[cfg(all(unix, feature = "process"))]
#[cfg(all(unix, not(target_os = "redox"), feature = "process"))]
fn sort_groups(mut groups: Vec<gid_t>, egid: gid_t) -> Vec<gid_t> {
if let Some(index) = groups.iter().position(|&x| x == egid) {
groups[..=index].rotate_right(1);

View file

@ -14,7 +14,7 @@ use time::UtcOffset;
const LINUX_MTAB: &str = "/etc/mtab";
#[cfg(any(target_os = "linux", target_os = "android"))]
const LINUX_MOUNTINFO: &str = "/proc/self/mountinfo";
#[cfg(unix)]
#[cfg(all(unix, not(target_os = "redox")))]
static MOUNT_OPT_BIND: &str = "bind";
#[cfg(windows)]
const MAX_PATH: usize = 266;
@ -318,7 +318,7 @@ impl From<StatFs> for MountInfo {
}
}
#[cfg(unix)]
#[cfg(all(unix, not(target_os = "redox")))]
fn is_dummy_filesystem(fs_type: &str, mount_option: &str) -> bool {
// spell-checker:disable
match fs_type {
@ -337,14 +337,14 @@ fn is_dummy_filesystem(fs_type: &str, mount_option: &str) -> bool {
// spell-checker:enable
}
#[cfg(unix)]
#[cfg(all(unix, not(target_os = "redox")))]
fn is_remote_filesystem(dev_name: &str, fs_type: &str) -> bool {
dev_name.find(':').is_some()
|| (dev_name.starts_with("//") && fs_type == "smbfs" || fs_type == "cifs")
|| dev_name == "-hosts"
}
#[cfg(unix)]
#[cfg(all(unix, not(target_os = "redox")))]
fn mount_dev_id(mount_dir: &str) -> String {
use std::os::unix::fs::MetadataExt;