mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
ls: use cfg unix
This commit is contained in:
@@ -35,17 +35,7 @@ use term_grid::{DEFAULT_SEPARATOR_SIZE, Direction, Filling, Grid, GridOptions};
|
||||
use uucore::entries;
|
||||
#[cfg(all(unix, not(any(target_os = "android", target_os = "macos"))))]
|
||||
use uucore::fsxattr::has_acl;
|
||||
#[cfg(any(
|
||||
target_os = "linux",
|
||||
target_os = "android",
|
||||
target_os = "freebsd",
|
||||
target_os = "dragonfly",
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd",
|
||||
target_os = "illumos",
|
||||
target_os = "solaris",
|
||||
target_vendor = "apple"
|
||||
))]
|
||||
#[cfg(unix)]
|
||||
use uucore::libc::{dev_t, major, minor};
|
||||
use uucore::{
|
||||
error::UResult,
|
||||
@@ -627,17 +617,7 @@ fn display_date(
|
||||
}
|
||||
|
||||
fn display_len_or_rdev(metadata: &Metadata, config: &Config) -> SizeOrDeviceId {
|
||||
#[cfg(any(
|
||||
target_os = "linux",
|
||||
target_os = "android",
|
||||
target_os = "freebsd",
|
||||
target_os = "dragonfly",
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd",
|
||||
target_os = "illumos",
|
||||
target_os = "solaris",
|
||||
target_vendor = "apple"
|
||||
))]
|
||||
#[cfg(unix)]
|
||||
{
|
||||
let ft = metadata.file_type();
|
||||
if ft.is_char_device() || ft.is_block_device() {
|
||||
|
||||
@@ -5054,16 +5054,7 @@ fn test_tabsize_formatting() {
|
||||
.stdout_is("aaaaaaaa cccc\nbbbb dddddddd\n");
|
||||
}
|
||||
|
||||
#[cfg(any(
|
||||
target_os = "linux",
|
||||
target_os = "freebsd",
|
||||
target_os = "dragonfly",
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd",
|
||||
target_os = "illumos",
|
||||
target_os = "solaris",
|
||||
target_vendor = "apple"
|
||||
))]
|
||||
#[cfg(all(unix, not(target_os = "android")))]
|
||||
#[test]
|
||||
fn test_device_number() {
|
||||
use std::fs::{metadata, read_dir};
|
||||
|
||||
Reference in New Issue
Block a user