1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

Merge pull request #5932 from cakebaker/uucore_fix_never_used_warnings_on_redox

uucore: fix "X is never used" warnings on Redox
This commit is contained in:
Sylvestre Ledru 2024-02-03 07:46:29 +01:00 committed by GitHub
commit b485a480cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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)) 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> { fn sort_groups(mut groups: Vec<gid_t>, egid: gid_t) -> Vec<gid_t> {
if let Some(index) = groups.iter().position(|&x| x == egid) { if let Some(index) = groups.iter().position(|&x| x == egid) {
groups[..=index].rotate_right(1); groups[..=index].rotate_right(1);

View file

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