Skip to content

Commit 6500cdd

Browse files
committed
Disk (Android): fix compiling
1 parent 4146bb6 commit 6500cdd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/detection/disk/disk_linux.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ static void detectName(FFDisk* disk)
149149

150150
#ifdef __ANDROID__
151151

152-
static void detectType(FF_MAYBE_UNUSED const FFlist* disks, FFDisk* currentDisk)
152+
static void detectType(FF_MAYBE_UNUSED const FFlist* disks, FFDisk* currentDisk, FF_MAYBE_UNUSED struct mntent* device)
153153
{
154154
if(ffStrbufEqualS(&currentDisk->mountpoint, "/") || ffStrbufEqualS(&currentDisk->mountpoint, "/storage/emulated"))
155155
currentDisk->type = FF_DISK_VOLUME_TYPE_REGULAR_BIT;
@@ -259,6 +259,11 @@ static void detectStats(FFDisk* disk)
259259
if (statx(0, disk->mountpoint.chars, 0, STATX_BTIME, &stx) == 0 && (stx.stx_mask & STATX_BTIME))
260260
disk->createTime = (uint64_t)((stx.stx_btime.tv_sec * 1000) + (stx.stx_btime.tv_nsec / 1000000));
261261
#endif
262+
263+
#ifdef __ANDROID__ // hasmntopt requires a higher Android API level
264+
if(fs.f_flag & ST_RDONLY)
265+
disk->type |= FF_DISK_VOLUME_TYPE_READONLY_BIT;
266+
#endif
262267
}
263268

264269
const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks)

0 commit comments

Comments
 (0)