Disk (BSD): try detecting disk label

This commit is contained in:
李通洲
2023-08-18 09:52:21 +08:00
parent 67fe1e66b5
commit 55b9e274b6
+5
View File
@@ -3,6 +3,8 @@
#include <sys/mount.h>
#ifdef __FreeBSD__
#include <sys/disklabel.h>
static void detectFsInfo(struct statfs* fs, FFDisk* disk)
{
if(
@@ -21,6 +23,9 @@ static void detectFsInfo(struct statfs* fs, FFDisk* disk)
disk->type = FF_DISK_TYPE_REGULAR_BIT;
ffStrbufInit(&disk->name);
struct disklabel* lab = getdiskbyname(fs->f_mntfromname);
if(lab)
ffStrbufSetS(&disk->name, lab->d_packname);
}
#else
void detectFsInfo(struct statfs* fs, FFDisk* disk);