diff --git a/src/detection/disk/disk_linux.c b/src/detection/disk/disk_linux.c index ae4de417f..c8e9fa276 100644 --- a/src/detection/disk/disk_linux.c +++ b/src/detection/disk/disk_linux.c @@ -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(¤tDisk->mountpoint, "/") || ffStrbufEqualS(¤tDisk->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)