From 77fde110397bf2dc362686774505ef0f0845ae45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 8 Jun 2023 21:48:32 +0800 Subject: [PATCH] Disk (Linux): fix fastfetch doesn't show Windows drives (`/mnt/c`) --- src/detection/disk/disk_linux.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/detection/disk/disk_linux.c b/src/detection/disk/disk_linux.c index 2d54b20e2..6f4eab2bc 100644 --- a/src/detection/disk/disk_linux.c +++ b/src/detection/disk/disk_linux.c @@ -17,14 +17,6 @@ static bool isPhysicalDevice(FFstrbuf* device) { - struct stat deviceStat; - if(stat(device->chars, &deviceStat) != 0) - return false; - - //Ignore all devices that are not block devices - if(!S_ISBLK(deviceStat.st_mode)) - return false; - //DrvFs is a filesystem plugin to WSL that was designed to support interop between WSL and the Windows filesystem. if(ffStrbufEqualS(device, "drvfs")) return true; @@ -33,6 +25,14 @@ static bool isPhysicalDevice(FFstrbuf* device) if(ffStrbufStartsWithS(device, "rpool/")) return true; + struct stat deviceStat; + if(stat(device->chars, &deviceStat) != 0) + return false; + + //Ignore all devices that are not block devices + if(!S_ISBLK(deviceStat.st_mode)) + return false; + //Pseudo filesystems don't have a device in /dev if(!ffStrbufStartsWithS(device, "/dev/")) return false;