From: Klas Lindfors Date: Tue, 18 Sep 2012 06:59:31 +0000 (+0200) Subject: use passed-in vendor_id and product_id instead of constants X-Git-Tag: v1.8.0~53 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d589c000da52fbb6bb02f5c46e9789b883860156;p=yubikey-personalization use passed-in vendor_id and product_id instead of constants --- diff --git a/ykcore/ykcore_libusb-1.0.c b/ykcore/ykcore_libusb-1.0.c index b7df1b3..03630a6 100644 --- a/ykcore/ykcore_libusb-1.0.c +++ b/ykcore/ykcore_libusb-1.0.c @@ -171,7 +171,7 @@ void *_ykusb_open_device(int vendor_id, int product_id) if (ykl_errno != 0) goto done; - if (desc.idVendor == YUBICO_VID && desc.idProduct == YUBIKEY_PID) { + if (desc.idVendor == vendor_id && desc.idProduct == product_id) { rc = YK_EUSBERR; ykl_errno = libusb_open(dev, &h); if (ykl_errno != 0) diff --git a/ykcore/ykcore_libusb.c b/ykcore/ykcore_libusb.c index c210478..dac4fc1 100644 --- a/ykcore/ykcore_libusb.c +++ b/ykcore/ykcore_libusb.c @@ -155,8 +155,8 @@ void *_ykusb_open_device(int vendor_id, int product_id) for (bus = usb_get_busses(); bus; bus = bus->next) { rc = YK_ENOKEY; for (dev = bus->devices; dev; dev = dev->next) - if (dev->descriptor.idVendor == YUBICO_VID - && dev->descriptor.idProduct == YUBIKEY_PID) { + if (dev->descriptor.idVendor == vendor_id + && dev->descriptor.idProduct == product_id) { rc = YK_EUSBERR; h = usb_open(dev); #ifdef LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP