mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
getpwuid is linux platform only currently.
This commit is contained in:
+6
-4
@@ -164,7 +164,9 @@ fn cstr2string(cstr: *const c_char) -> String {
|
||||
unsafe { String::from_utf8_lossy(CStr::from_ptr(cstr).to_bytes()).to_string() }
|
||||
}
|
||||
|
||||
#[cfg(target_family = "unix")]
|
||||
// Currently getpwuid is `linux` target only. If it's broken out into
|
||||
// a posix-compliant attribute this can be updated...
|
||||
#[cfg(target_family = "linux")]
|
||||
fn display_uname(metadata: &Metadata) -> String {
|
||||
use std::os::unix::fs::MetadataExt;
|
||||
|
||||
@@ -176,7 +178,7 @@ fn display_uname(metadata: &Metadata) -> String {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_family = "unix")]
|
||||
#[cfg(target_family = "linux")]
|
||||
fn display_group(metadata: &Metadata) -> String {
|
||||
use std::os::unix::fs::MetadataExt;
|
||||
|
||||
@@ -188,13 +190,13 @@ fn display_group(metadata: &Metadata) -> String {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_family = "windows")]
|
||||
#[cfg(not(target_family = "linux"))]
|
||||
#[allow(unused_variables)]
|
||||
fn display_uname(metadata: &Metadata) -> String {
|
||||
"somebody".to_string()
|
||||
}
|
||||
|
||||
#[cfg(target_family = "windows")]
|
||||
#[cfg(not(target_family = "linux"))]
|
||||
#[allow(unused_variables)]
|
||||
fn display_group(metadata: &Metadata) -> String {
|
||||
"somegroup".to_string()
|
||||
|
||||
Reference in New Issue
Block a user