From 5397787824ff599b8a99852423ff34dc51606589 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Thu, 15 Mar 2018 20:45:26 +0100 Subject: [PATCH] Skip fifos, sockets, .. when using --type f/d/l --- src/walk.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/walk.rs b/src/walk.rs index 954a978..1c5b515 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -203,6 +203,11 @@ pub fn scan(path_vec: &[PathBuf], pattern: Arc, config: Arc) { || (entry_type.is_symlink() && !file_types.symlinks) { return ignore::WalkState::Continue; + } else if !(entry_type.is_file() || entry_type.is_dir() + || entry_type.is_symlink()) + { + // This is probably a block device, char device, fifo or socket. Skip it. + return ignore::WalkState::Continue; } } else { return ignore::WalkState::Continue;