mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-01 10:32:35 +01:00
Disk: use statvfs64 only when __USE_LARGEFILE64 is defined
This commit is contained in:
@@ -73,9 +73,15 @@ void ffDetectDisksImpl(FFDiskResult* disks)
|
||||
#endif
|
||||
|
||||
//Detects stats
|
||||
struct statvfs64 fs;
|
||||
if(statvfs64(disk->mountpoint.chars, &fs) != 0)
|
||||
memset(&fs, 0, sizeof(struct statvfs64)); //Set all values to 0, so our values get initialized to 0 too
|
||||
#ifdef __USE_LARGEFILE64
|
||||
struct statvfs64 fs;
|
||||
if(statvfs64(disk->mountpoint.chars, &fs) != 0)
|
||||
memset(&fs, 0, sizeof(struct statvfs64)); //Set all values to 0, so our values get initialized to 0 too
|
||||
#else
|
||||
struct statvfs fs;
|
||||
if(statvfs(disk->mountpoint.chars, &fs) != 0)
|
||||
memset(&fs, 0, sizeof(struct statvfs)); //Set all values to 0, so our values get initialized to 0 too
|
||||
#endif
|
||||
|
||||
disk->bytesTotal = fs.f_blocks * fs.f_frsize;
|
||||
disk->bytesUsed = disk->bytesTotal - (fs.f_bavail * fs.f_frsize);
|
||||
|
||||
Reference in New Issue
Block a user