From: Klas Lindfors Date: Wed, 9 Jan 2013 13:02:55 +0000 (+0100) Subject: fixup EMORETHANONE for windows X-Git-Tag: v1.11.2^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13c87a31df5e902ad012f7d924ab6db39ab08d66;p=yubikey-personalization fixup EMORETHANONE for windows --- diff --git a/ykcore/ykcore_windows.c b/ykcore/ykcore_windows.c index 4f437ff..dafac02 100644 --- a/ykcore/ykcore_windows.c +++ b/ykcore/ykcore_windows.c @@ -100,7 +100,9 @@ void * _ykusb_open_device(int vendor_id, int *product_ids, size_t pids_len) ret_handle = m_handle; break; } else { - rc = YK_EMORETHANONE; + yk_errno = YK_EMORETHANONE; + ret_handle = NULL; + CloseHandle (m_handle); goto done; } } @@ -115,6 +117,9 @@ void * _ykusb_open_device(int vendor_id, int *product_ids, size_t pids_len) free (pi); } + if(ret_handle != NULL) { + goto done; + } yk_errno = YK_ENOKEY;