diff options
author | Pete Batard <pbatard@gmail.com> | 2010-04-20 15:26:47 +0100 |
---|---|---|
committer | Pete Batard <pbatard@gmail.com> | 2010-04-20 15:26:47 +0100 |
commit | e3d7fc014b60300c91f737248bacdc2c6e8eda12 (patch) | |
tree | 4a602e5bb8c97c39a248e8520655d8f113aa6c1c | |
parent | 4ab789bb911d4b47556ef078c379d05e50efa703 (diff) | |
download | libusb-e3d7fc014b60300c91f737248bacdc2c6e8eda12.tar.gz |
merged official 1.0.6 -> 1.0.7 release changes
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | libusb/io.c | 7 | ||||
-rw-r--r-- | libusb/os/darwin_usb.c | 3 | ||||
-rw-r--r-- | libusb/os/linux_usbfs.c | 9 |
5 files changed, 20 insertions, 5 deletions
@@ -1,6 +1,10 @@ This file lists notable changes in each release. For the full history of all changes, see ChangeLog. +2010-04-19: v1.0.7 +* Bug fixes and documentation tweaks +* Add more interface class definitions + 2009-11-22: v1.0.6 * Bug fixes * Increase libusb_handle_events() timeout to 60s for powersaving diff --git a/configure.ac b/configure.ac index 6feff5d..2a7f750 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ m4_define(LIBUSB_MAJOR, [1]) m4_define(LIBUSB_MINOR, [0]) -m4_define(LIBUSB_MICRO, [6]) +m4_define(LIBUSB_MICRO, [7]) AC_INIT([libusb], LIBUSB_MAJOR.LIBUSB_MINOR.LIBUSB_MICRO, [libusb-devel@lists.sourceforge.net], [libusb], [http://www.libusb.org/]) diff --git a/libusb/io.c b/libusb/io.c index 3ddd947..febe121 100644 --- a/libusb/io.c +++ b/libusb/io.c @@ -598,6 +598,13 @@ while (user_has_not_requested_exit) * these moments occur. This means that you need to adjust your * poll()/select() timeout accordingly. * + * libusb provides you with a set of file descriptors to poll and expects you + * to poll all of them, treating them as a single entity. The meaning of each + * file descriptor in the set is an internal implementation detail, + * platform-dependent and may vary from release to release. Don't try and + * interpret the meaning of the file descriptors, just do as libusb indicates, + * polling all of them at once. + * * In pseudo-code, you want something that looks like: \code // initialise libusb diff --git a/libusb/os/darwin_usb.c b/libusb/os/darwin_usb.c index 8a6d8ee..3411554 100644 --- a/libusb/os/darwin_usb.c +++ b/libusb/os/darwin_usb.c @@ -547,6 +547,9 @@ static int process_new_device (struct libusb_context *ctx, usb_device_t **device if (need_unref) libusb_unref_device(dev); + if (need_unref) + libusb_unref_device(dev); + return 0; } diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c index 53d2e94..b398577 100644 --- a/libusb/os/linux_usbfs.c +++ b/libusb/os/linux_usbfs.c @@ -381,7 +381,8 @@ static int sysfs_get_active_config(struct libusb_device *dev, int *config) /* takes a usbfs/descriptors fd seeked to the start of a configuration, and * seeks to the next one. */ -static int seek_to_next_config(struct libusb_context *ctx, int fd) +static int seek_to_next_config(struct libusb_context *ctx, int fd, + int host_endian) { struct libusb_config_descriptor config; unsigned char tmp[6]; @@ -399,7 +400,7 @@ static int seek_to_next_config(struct libusb_context *ctx, int fd) } /* seek forward to end of config */ - usbi_parse_descriptor(tmp, "bbwbb", &config, 0); + usbi_parse_descriptor(tmp, "bbwbb", &config, host_endian); off = lseek(fd, config.wTotalLength - sizeof(tmp), SEEK_CUR); if (off < 0) { usbi_err(ctx, "seek failed ret=%d errno=%d", off, errno); @@ -476,7 +477,7 @@ static int sysfs_get_active_config_descriptor(struct libusb_device *dev, if (off < 0) return LIBUSB_ERROR_IO; - r = seek_to_next_config(DEVICE_CTX(dev), fd); + r = seek_to_next_config(DEVICE_CTX(dev), fd, 1); if (r < 0) return r; } @@ -531,7 +532,7 @@ static int get_config_descriptor(struct libusb_context *ctx, int fd, /* might need to skip some configuration descriptors to reach the * requested configuration */ while (config_index > 0) { - r = seek_to_next_config(ctx, fd); + r = seek_to_next_config(ctx, fd, 0); if (r < 0) return r; config_index--; |