Disk: fix size detection on 32bit Linux

Ref: #337
This commit is contained in:
李通洲
2022-11-18 00:10:16 +08:00
parent f1cc94207e
commit 859f645fe5
+3 -3
View File
@@ -73,9 +73,9 @@ void ffDetectDisksImpl(FFDiskResult* disks)
#endif
//Detects stats
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
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
disk->bytesTotal = fs.f_blocks * fs.f_frsize;
disk->bytesUsed = disk->bytesTotal - (fs.f_bavail * fs.f_frsize);