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
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -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
}
+1
View File
@@ -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";