mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 17:41:41 +01:00
Disk: only detect folders that specified by --disk-folders
Can be used to improve performance by ignoring network disks
This commit is contained in:
@@ -250,7 +250,7 @@ static void detectStats(FFDisk* disk)
|
||||
#endif
|
||||
}
|
||||
|
||||
const char* ffDetectDisksImpl(FFlist* disks)
|
||||
const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks)
|
||||
{
|
||||
FILE* mountsFile = setmntent("/proc/mounts", "r");
|
||||
if(mountsFile == NULL)
|
||||
@@ -260,7 +260,12 @@ const char* ffDetectDisksImpl(FFlist* disks)
|
||||
|
||||
while((device = getmntent(mountsFile)))
|
||||
{
|
||||
if(!isPhysicalDevice(device))
|
||||
if (__builtin_expect(options->folders.length, 0))
|
||||
{
|
||||
if (!ffDiskMatchMountpoint(options, device->mnt_dir))
|
||||
continue;
|
||||
}
|
||||
else if(!isPhysicalDevice(device))
|
||||
continue;
|
||||
|
||||
//We have a valid device, add it to the list
|
||||
|
||||
Reference in New Issue
Block a user