make usb etokens work; ok sturm@, Douglas Santos

This commit is contained in:
markus 2005-11-24 12:23:04 +00:00
parent dc75d1befd
commit 17de820676
2 changed files with 36 additions and 1 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.1.1.1 2005/10/04 21:58:54 alek Exp $
# $OpenBSD: Makefile,v 1.2 2005/11/24 12:23:04 markus Exp $
COMMENT= "drivers for several smart card readers"
DISTNAME= openct-0.6.6
PKGNAME= ${DISTNAME}p0
CATEGORIES= security
HOMEPAGE= http://www.opensc.org/openct

View File

@ -0,0 +1,34 @@
$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
}
/*