mirror of
https://github.com/uutils/coreutils
synced 2024-12-13 23:02:38 +00:00
tail: Fix random errors mainly on macos for piped input. Treat resolved paths to /dev/fd/0 as pipe.
Closes #3953
This commit is contained in:
parent
6051c4693f
commit
96321f958c
2 changed files with 5 additions and 1 deletions
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue