From: Klas Lindfors Date: Fri, 14 Sep 2012 07:23:06 +0000 (+0200) Subject: return error when libusb_init fails X-Git-Tag: v1.8.0~74 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4466317c5fef55a4e9b931f0d476aa146ecc61d;p=yubikey-personalization return error when libusb_init fails --- diff --git a/ykcore/ykcore_libusb-1.0.c b/ykcore/ykcore_libusb-1.0.c index d1d7105..8dbb985 100644 --- a/ykcore/ykcore_libusb-1.0.c +++ b/ykcore/ykcore_libusb-1.0.c @@ -135,7 +135,11 @@ int _ykusb_read(void *dev, int report_type, int report_number, int _ykusb_start(void) { - libusb_init(NULL); + ykl_errno = libusb_init(NULL); + if(ykl_errno) { + yk_errno = YK_EUSBERR; + return ykl_errno; + } libusb_inited = 1; return 1; }