mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07: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:
@@ -75,7 +75,10 @@ impl Input {
|
||||
}
|
||||
InputKind::File(_) | InputKind::Stdin => {
|
||||
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 {
|
||||
None
|
||||
}
|
||||
|
||||
@@ -18,3 +18,4 @@ pub static BACKEND: &str = "inotify";
|
||||
pub static BACKEND: &str = "kqueue";
|
||||
#[cfg(target_os = "windows")]
|
||||
pub static BACKEND: &str = "ReadDirectoryChanges";
|
||||
pub static FD0: &str = "/dev/fd/0";
|
||||
|
||||
Reference in New Issue
Block a user