aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Haggett <simon.haggett@realvnc.com>2013-07-11 17:27:00 +0100
committerPete Batard <pete@akeo.ie>2013-08-08 00:37:30 +0100
commit388a9a88059cb5b5a8088788f5ccd6c3eec80f62 (patch)
treeed1ff5fe7ce5749c5d1997872fafa421cef54869
parenta3b92f8fe1953015322ed400570701943a59f3af (diff)
downloadandroid_external_libusbx-388a9a88059cb5b5a8088788f5ccd6c3eec80f62.tar.gz
android_external_libusbx-388a9a88059cb5b5a8088788f5ccd6c3eec80f62.tar.bz2
android_external_libusbx-388a9a88059cb5b5a8088788f5ccd6c3eec80f62.zip
Windows: fd_to_winfd() shouldn't treat fd 0 as invalid
* fd_to_winfd() currently returns INVALID_WINFD if fd is 0, but usbi_create_fd() can legally assign an fd number of 0 if poll_fd[0] is not already occupied. * Transfers which are assigned an fd number of 0 for their event handle are then unable to have their event handle retrieved later on. See http://libusbx.1081486.n5.nabble.com/Libusbx-devel-PATCH-1-1-Windows-fd-to-winfd-shouldn-t-treat-fd-0-as-invalid-tt1535.html
-rw-r--r--libusb/os/poll_windows.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libusb/os/poll_windows.c b/libusb/os/poll_windows.c
index 7ed19ba..abe8761 100644
--- a/libusb/os/poll_windows.c
+++ b/libusb/os/poll_windows.c
@@ -428,7 +428,7 @@ struct winfd fd_to_winfd(int fd)
CHECK_INIT_POLLING;
- if (fd <= 0)
+ if (fd < 0)
return INVALID_WINFD;
for (i=0; i<MAX_FDS; i++) {