openbsd-ports/security/openct/patches/patch-src_ifd_sys-bsd_c

35 lines
868 B
Plaintext

$OpenBSD: patch-src_ifd_sys-bsd_c,v 1.1 2005/11/24 12:23:04 markus Exp $
--- src/ifd/sys-bsd.c.orig Sun Jun 12 11:35:17 2005
+++ src/ifd/sys-bsd.c Wed Nov 23 12:14:56 2005
@@ -37,8 +37,10 @@ int ifd_sysdep_device_type(const char *n
if (!strncmp(name, "/dev/ugen", 9)) {
ifd_debug(1, "BSD: returning IFD_DEVICE_TYPE_USB");
+#ifndef __OpenBSD__
if (stat(name, &stb) < 0)
return -1;
+#endif
return IFD_DEVICE_TYPE_USB;
}
@@ -329,7 +331,19 @@ int ifd_sysdep_usb_release_interface(ifd
int ifd_sysdep_usb_open(const char *device, int flags)
{
+#ifdef __OpenBSD__
+ char *path;
+ int fd;
+
+ if (asprintf(&path, "%s.00", device) < 0)
+ return -1;
+ ifd_debug(1, "BSD: ifd_sysdep_usb_open(%s)", path);
+ fd = open(path, O_EXCL | O_RDWR);
+ free(path);
+ return fd;
+#else
return open(device, O_EXCL | O_RDWR);
+#endif
}
/*