Skip to content

Commit 55b9e27

Browse files
committed
Disk (BSD): try detecting disk label
1 parent 67fe1e6 commit 55b9e27

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/detection/disk/disk_bsd.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#include <sys/mount.h>
44

55
#ifdef __FreeBSD__
6+
#include <sys/disklabel.h>
7+
68
static void detectFsInfo(struct statfs* fs, FFDisk* disk)
79
{
810
if(
@@ -21,6 +23,9 @@ static void detectFsInfo(struct statfs* fs, FFDisk* disk)
2123
disk->type = FF_DISK_TYPE_REGULAR_BIT;
2224

2325
ffStrbufInit(&disk->name);
26+
struct disklabel* lab = getdiskbyname(fs->f_mntfromname);
27+
if(lab)
28+
ffStrbufSetS(&disk->name, lab->d_packname);
2429
}
2530
#else
2631
void detectFsInfo(struct statfs* fs, FFDisk* disk);

0 commit comments

Comments
 (0)