summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dickens <christopher.a.dickens@gmail.com>2015-04-27 01:40:50 -0700
committerChris Dickens <christopher.a.dickens@gmail.com>2015-04-27 01:44:34 -0700
commitdfb5c0723f69413ddf7a6bf05fb493a119031268 (patch)
tree9c321ffac99de78638874a0f04135af14f7a4ba0
parent0dca8fdab1439d3dc36b57f3f0e7f4908c25052d (diff)
downloadlibusb-dfb5c0723f69413ddf7a6bf05fb493a119031268.tar.gz
Windows: Remove erroneous call to CloseHandle and add comments
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
-rw-r--r--libusb/os/windows_usb.c3
-rw-r--r--libusb/version_nano.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c
index 6a16f28..3c512f0 100644
--- a/libusb/os/windows_usb.c
+++ b/libusb/os/windows_usb.c
@@ -1012,6 +1012,8 @@ static int windows_init(struct libusb_context *ctx)
usbi_err(ctx, "could not get process affinity: %s", windows_error_str(0));
goto init_exit;
}
+ // The process affinity mask is a bitmask where each set bit represents a core on
+ // which this process is allowed to run, so we find the first set bit
for (i = 0; !(affinity & (1 << i)); i++);
affinity = (1 << i);
@@ -1027,7 +1029,6 @@ static int windows_init(struct libusb_context *ctx)
0, (unsigned int *)&timer_thread_id);
if (timer_thread == NULL) {
usbi_err(ctx, "unable to create timer thread - aborting");
- CloseHandle(event);
goto init_exit;
}
if (!SetThreadAffinityMask(timer_thread, affinity)) {
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 56497cd..4ecbd70 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 10969
+#define LIBUSB_NANO 10970