Skip to content

Commit 2aeb068

Browse files
authored
Don't use deprecated kIOMasterPortDefault (#406)
`kIOMasterPortDefault` is deprecated since macOS 12.0. One alternative is to use named constant `kIOMainPortDefault` which is not available before macOS 12.0. Both named constants are just an alias for `NULL`, so it is simpler to use it directly instead. Fixes: #377
1 parent cd95af8 commit 2aeb068

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mac/hid.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -790,12 +790,12 @@ static io_registry_entry_t hid_open_service_registry_from_path(const char *path)
790790
char *endptr;
791791
uint64_t entry_id = strtoull(path + 10, &endptr, 10);
792792
if (*endptr == '\0') {
793-
return IOServiceGetMatchingService(kIOMasterPortDefault, IORegistryEntryIDMatching(entry_id));
793+
return IOServiceGetMatchingService(NULL, IORegistryEntryIDMatching(entry_id));
794794
}
795795
}
796796
else {
797797
/* Fallback to older format of the path */
798-
return IORegistryEntryFromPath(kIOMasterPortDefault, path);
798+
return IORegistryEntryFromPath(NULL, path);
799799
}
800800

801801
return MACH_PORT_NULL;

0 commit comments

Comments
 (0)