Files
macports-ports/security/libfido2/files/patch-nosigpipe.diff
Blake GarnerandHerby Gillot 5322ce0b5f libfido2: update to 1.17.0
* switch to official Yubico release tarball instead of GitHub
  tarball (upstream changed packaging between 1.16.0 and 1.17.0)
* split legacy compatibility patches into focused files:
  - patch-compat-pre1012.diff: fix kIOHIDManagerOptionNone on < 10.12
  - patch-nosigpipe.diff: guard F_SETNOSIGPIPE on 10.5–10.6
  - patch-fallthrough.diff: fix FALLTHROUGH attribute on < 10.10
  - patch-bzero.diff: declare bzero hidden by _POSIX_C_SOURCE on < 10.9
  - patch-cmake-no-fallthrough.diff: drop -Wimplicit-fallthrough on 10.5–10.6

Closes: https://trac.macports.org/ticket/64833
Closes: https://trac.macports.org/ticket/68333
2026-04-19 13:55:22 -04:00

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) {