From 896e803feb84fb2e1a6b57572b6f2c4d447c8b8f Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 15 Mar 2019 12:15:38 +0100 Subject: [PATCH] src/pxar/sequential_decoder.rs: dump_entry - fix FIFO/SOCKET handling --- src/pxar/sequential_decoder.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/pxar/sequential_decoder.rs b/src/pxar/sequential_decoder.rs index 9f2c59bc..22663e5f 100644 --- a/src/pxar/sequential_decoder.rs +++ b/src/pxar/sequential_decoder.rs @@ -498,8 +498,9 @@ impl <'a, R: Read> SequentialDecoder<'a, R> { } } } - } else { - + } else if (ifmt == libc::S_IFBLK) || (ifmt == libc::S_IFCHR) || + (ifmt == libc::S_IFLNK) || (ifmt == libc::S_IFREG) + { let head: CaFormatHeader = self.read_item()?; if verbose { print_head(&head); @@ -530,8 +531,17 @@ impl <'a, R: Read> SequentialDecoder<'a, R> { panic!("got unexpected header type inside non-directory"); } } + } else if ifmt == libc::S_IFIFO { + if verbose { + println!("Fifo:"); + } + } else if ifmt == libc::S_IFSOCK { + if verbose { + println!("Socket:"); + } + } else { + panic!("unknown st_mode"); } - Ok(()) }