mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
40 lines
955 B
Diff
40 lines
955 B
Diff
--- src/hid_osx.c.orig
|
|||
|
|
+++ src/hid_osx.c
|
||
|
|
@@ -347,6 +347,7 @@
|
||
|
|
CFRunLoopStop(CFRunLoopGetCurrent());
|
||
|
|
}
|
||
|
|
|
||
|
|
+#if MAC_OS_X_VERSION_MIN_REQUIRED > 1060
|
||
|
|
static int
|
||
|
|
set_nonblock(int fd)
|
||
|
|
{
|
||
|
|
@@ -394,6 +395,7 @@
|
||
|
|
return (IOServiceGetMatchingService(kIOMainPortDefault,
|
||
|
|
IORegistryEntryIDMatching(id)));
|
||
|
|
}
|
||
|
|
+#endif
|
||
|
|
|
||
|
|
void *
|
||
|
|
fido_hid_open(const char *path)
|
||
|
|
@@ -417,6 +419,7 @@
|
||
|
|
goto fail;
|
||
|
|
}
|
||
|
|
|
||
|
|
+#if MAC_OS_X_VERSION_MIN_REQUIRED > 1060
|
||
|
|
if (set_nonblock(ctx->report_pipe[0]) < 0 ||
|
||
|
|
set_nonblock(ctx->report_pipe[1]) < 0) {
|
||
|
|
fido_log_debug("%s: set_nonblock", __func__);
|
||
|
|
@@ -432,6 +435,12 @@
|
||
|
|
fido_log_debug("%s: get_ioreg_entry: %s", __func__, path);
|
||
|
|
goto fail;
|
||
|
|
}
|
||
|
|
+#else
|
||
|
|
+ if ((entry = IORegistryEntryFromPath(kIOMainPortDefault,path)) == MACH_PORT_NULL) {
|
||
|
|
+ fido_log_debug("%s: IORegistryEntryFromPath: %s", __func__, path);
|
||
|
|
+ goto fail;
|
||
|
|
+ }
|
||
|
|
+#endif
|
||
|
|
|
||
|
|
if ((ctx->ref = IOHIDDeviceCreate(kCFAllocatorDefault,
|
||
|
|
entry)) == NULL) {
|