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:
parent
cc0e1e3458
commit
134c1aa407
1 changed files with 7 additions and 2 deletions
|
@ -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 {
|
fn cached_gid2grp(gid: u32) -> String {
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
static ref GID_CACHE: Mutex<HashMap<u32, String>> = Mutex::new(HashMap::new());
|
static ref GID_CACHE: Mutex<HashMap<u32, String>> = Mutex::new(HashMap::new());
|
||||||
|
@ -1603,7 +1603,7 @@ fn cached_gid2grp(gid: u32) -> String {
|
||||||
.clone()
|
.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(all(unix, not(target_os = "redox")))]
|
||||||
fn display_group(metadata: &Metadata, config: &Config) -> String {
|
fn display_group(metadata: &Metadata, config: &Config) -> String {
|
||||||
if config.long.numeric_uid_gid {
|
if config.long.numeric_uid_gid {
|
||||||
metadata.gid().to_string()
|
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))]
|
#[cfg(not(unix))]
|
||||||
fn display_uname(_metadata: &Metadata, _config: &Config) -> String {
|
fn display_uname(_metadata: &Metadata, _config: &Config) -> String {
|
||||||
"somebody".to_string()
|
"somebody".to_string()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue