1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

ls: do not use gid2grp on redox

This commit is contained in:
Jeremy Soller 2021-08-06 13:34:17 -06:00
parent cc0e1e3458
commit 134c1aa407
No known key found for this signature in database
GPG key ID: E988B49EE78A7FB1

View file

@ -1590,7 +1590,7 @@ fn display_uname(metadata: &Metadata, config: &Config) -> String {
}
}
#[cfg(unix)]
#[cfg(all(unix, not(target_os = "redox")))]
fn cached_gid2grp(gid: u32) -> String {
lazy_static! {
static ref GID_CACHE: Mutex<HashMap<u32, String>> = Mutex::new(HashMap::new());
@ -1603,7 +1603,7 @@ fn cached_gid2grp(gid: u32) -> String {
.clone()
}
#[cfg(unix)]
#[cfg(all(unix, not(target_os = "redox")))]
fn display_group(metadata: &Metadata, config: &Config) -> String {
if config.long.numeric_uid_gid {
metadata.gid().to_string()
@ -1612,6 +1612,11 @@ fn display_group(metadata: &Metadata, config: &Config) -> String {
}
}
#[cfg(target_os = "redox")]
fn display_group(metadata: &Metadata, config: &Config) -> String {
metadata.gid().to_string()
}
#[cfg(not(unix))]
fn display_uname(_metadata: &Metadata, _config: &Config) -> String {
"somebody".to_string()