Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 13 additions & 16 deletions src/uu/stdbuf/src/stdbuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,9 @@ mod options {

#[cfg(all(
not(feature = "feat_external_libstdbuf"),
any(
target_os = "linux",
target_os = "android",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd",
target_os = "dragonfly"
)
unix,
not(target_vendor = "apple"),
not(target_os = "cygwin")
))]
const STDBUF_INJECT: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/libstdbuf.so"));

Expand Down Expand Up @@ -84,14 +79,7 @@ enum ProgramOptionsError {
ValueTooLarge(String),
}

#[cfg(any(
target_os = "linux",
target_os = "android",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd",
target_os = "dragonfly"
))]
#[cfg(all(unix, not(target_vendor = "apple"), not(target_os = "cygwin")))]
#[expect(
clippy::unnecessary_wraps,
reason = "fn sig must match on all platforms"
Expand All @@ -109,6 +97,15 @@ fn preload_strings() -> UResult<(&'static str, &'static str)> {
Ok(("DYLD_LIBRARY_PATH", "dylib"))
}

#[cfg(target_os = "cygwin")]
#[expect(
clippy::unnecessary_wraps,
reason = "fn sig must match on all platforms"
)]
fn preload_strings() -> UResult<(&'static str, &'static str)> {
Ok(("LD_PRELOAD", "dll"))
}

fn check_option(matches: &ArgMatches, name: &str) -> Result<BufferType, ProgramOptionsError> {
match matches.get_one::<String>(name) {
Some(value) => match value.as_str() {
Expand Down
Loading