From af960311c029f40bf5fbb7ced8db7fbf919d6880 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 17 Sep 2017 16:55:17 +0200 Subject: [PATCH] DiskUsage: ignore files from other volumes This allows us to get meaningful result for the system volume, which would otherwise scan both hpkg files, and their whole contents as mounted in the system/ hierarchy. Now only the packages are seen. Directories are not ignored, so system/ (which is a different mount point) will still be browsed, and system/packages (which is a shine-through) will be found and counted in the used space. --- src/apps/diskusage/Scanner.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/apps/diskusage/Scanner.cpp b/src/apps/diskusage/Scanner.cpp index fadbe7bce0..8d460c38cf 100644 --- a/src/apps/diskusage/Scanner.cpp +++ b/src/apps/diskusage/Scanner.cpp @@ -246,7 +246,11 @@ Scanner::_GetFileInfo(BDirectory* dir, FileInfo* parent) if (entry.IsSymLink()) continue; + if (entry.IsFile()) { + entry_ref ref; + if ((entry.GetRef(&ref) == B_OK) && (ref.device != Device())) + continue; FileInfo *child = new FileInfo; entry.GetRef(&child->ref); entry.GetSize(&child->size);