mirror of
https://github.com/uutils/coreutils
synced 2025-01-18 16:14:13 +00:00
uname: don't report OS as "GNU/Linux" without GNU
The `uname` `-o` switch reports the operating system used. If the GNU C standard library (glibc) is not in use, for example if musl is being used instead, report "Linux" instead of "GNU/Linux".
This commit is contained in:
parent
41d289377b
commit
c74b77aec8
1 changed files with 3 additions and 1 deletions
|
@ -30,8 +30,10 @@ pub mod options {
|
|||
pub static OS: &str = "operating-system";
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[cfg(all(target_os = "linux", any(target_env = "gnu", target_env = "")))]
|
||||
const HOST_OS: &str = "GNU/Linux";
|
||||
#[cfg(all(target_os = "linux", not(any(target_env = "gnu", target_env = ""))))]
|
||||
const HOST_OS: &str = "Linux";
|
||||
#[cfg(target_os = "windows")]
|
||||
const HOST_OS: &str = "Windows NT";
|
||||
#[cfg(target_os = "freebsd")]
|
||||
|
|
Loading…
Reference in a new issue