1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Merge pull request #3953 from Joining7943/fix-random-errors-on-macos

Fix random errors for piped input on macos
This commit is contained in:
Sylvestre Ledru 2022-09-21 10:00:48 +02:00 committed by GitHub
commit 9ed546b02c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -75,7 +75,10 @@ impl Input {
} }
InputKind::File(_) | InputKind::Stdin => { InputKind::File(_) | InputKind::Stdin => {
if cfg!(unix) { if cfg!(unix) {
PathBuf::from(text::DEV_STDIN).canonicalize().ok() match PathBuf::from(text::DEV_STDIN).canonicalize().ok() {
Some(path) if path != PathBuf::from(text::FD0) => Some(path),
Some(_) | None => None,
}
} else { } else {
None None
} }

View file

@ -18,3 +18,4 @@ pub static BACKEND: &str = "inotify";
pub static BACKEND: &str = "kqueue"; pub static BACKEND: &str = "kqueue";
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
pub static BACKEND: &str = "ReadDirectoryChanges"; pub static BACKEND: &str = "ReadDirectoryChanges";
pub static FD0: &str = "/dev/fd/0";