Skip to content

Commit 945aed7

Browse files
committed
Host (macOS): prefers hw.product than hw.model
... because `HW_MODEL` is deprecated
1 parent 1d4d68f commit 945aed7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/detection/host/host_apple.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ const char* getOthersByIokit(FFHostResult* host)
4545

4646
const char* ffDetectHost(FFHostResult* host)
4747
{
48-
const char* error = ffSysctlGetString("hw.model", &host->family);
48+
const char* error = ffSysctlGetString("hw.product", &host->family);
49+
if (error) error = ffSysctlGetString("hw.model", &host->family);
4950
if (error) return error;
5051

5152
ffStrbufSetStatic(&host->name, ffHostGetMacProductNameWithHwModel(&host->family));

0 commit comments

Comments
 (0)