Disk (Android): fix compiling

This commit is contained in:
李通洲
2024-10-17 14:29:27 +08:00
parent 4146bb6731
commit 6500cddc09
+6 -1
View File
@@ -149,7 +149,7 @@ static void detectName(FFDisk* disk)
#ifdef __ANDROID__
static void detectType(FF_MAYBE_UNUSED const FFlist* disks, FFDisk* currentDisk)
static void detectType(FF_MAYBE_UNUSED const FFlist* disks, FFDisk* currentDisk, FF_MAYBE_UNUSED struct mntent* device)
{
if(ffStrbufEqualS(&currentDisk->mountpoint, "/") || ffStrbufEqualS(&currentDisk->mountpoint, "/storage/emulated"))
currentDisk->type = FF_DISK_VOLUME_TYPE_REGULAR_BIT;
@@ -259,6 +259,11 @@ static void detectStats(FFDisk* disk)
if (statx(0, disk->mountpoint.chars, 0, STATX_BTIME, &stx) == 0 && (stx.stx_mask & STATX_BTIME))
disk->createTime = (uint64_t)((stx.stx_btime.tv_sec * 1000) + (stx.stx_btime.tv_nsec / 1000000));
#endif
#ifdef __ANDROID__ // hasmntopt requires a higher Android API level
if(fs.f_flag & ST_RDONLY)
disk->type |= FF_DISK_VOLUME_TYPE_READONLY_BIT;
#endif
}
const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks)