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:
commit
9ed546b02c
2 changed files with 5 additions and 1 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue