summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2011-01-20 16:21:32 +0000
committerPete Batard <pbatard@gmail.com>2011-01-20 16:21:32 +0000
commit43aecbb8f05995517479fa91db5d1db25be50d03 (patch)
tree2c96cf5c0e0e51be23cecdf45c8656c12965ba06
parent1363b3af3227367c7c5699ac28ea3386c1907914 (diff)
downloadlibusb-43aecbb8f05995517479fa91db5d1db25be50d03.tar.gz
fixed windows_init() return value on subsequent calls
* windows_init was set to return LIBUSB_ERROR_OTHER always if first run initialization was not executed * issue reported by Konrad Rosenbaum
-rw-r--r--libusb/os/windows_usb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c
index 2a70969..380adb2 100644
--- a/libusb/os/windows_usb.c
+++ b/libusb/os/windows_usb.c
@@ -855,12 +855,12 @@ static int windows_init(struct libusb_context *ctx)
// Create a hash table to store session ids. Second parameter is better if prime
htab_create(ctx, HTAB_SIZE);
-
- r = LIBUSB_SUCCESS;
}
+ // At this stage, either we went through full init successfully, or didn't need to
+ r = LIBUSB_SUCCESS;
init_exit: // Holds semaphore here.
- if(!concurrent_usage && r != LIBUSB_SUCCESS) { // First init failed?
+ if (!concurrent_usage && r != LIBUSB_SUCCESS) { // First init failed?
if (timer_thread) {
SetEvent(timer_request[1]); // actually the signal to quit the thread.
if (WAIT_OBJECT_0 != WaitForSingleObject(timer_thread, INFINITE)) {