Fix #5578, assume pipe file be zero-sized (#5594)

* Fix #5578, assume pipe file be zero-sized

* rust fmt
This commit is contained in:
Justin Ma 2022-05-20 22:27:21 +08:00 committed by GitHub
parent 6efd1bcb3f
commit 0ba86d7eb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -451,8 +451,10 @@ pub(crate) fn dir_entry_dict(
cols.push("size".to_string()); cols.push("size".to_string());
if let Some(md) = metadata { if let Some(md) = metadata {
let zero_sized = let zero_sized = file_type == "pipe"
file_type == "socket" || file_type == "block device" || file_type == "char device"; || file_type == "socket"
|| file_type == "char device"
|| file_type == "block device";
if md.is_dir() { if md.is_dir() {
if du { if du {