summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHector Martin <hector@marcansoft.com>2010-08-25 03:21:57 +0200
committerPete Batard <pbatard@gmail.com>2010-09-21 10:40:39 +0100
commit5e6cff30dc0773c83c0eddc62beb3700c94379ad (patch)
treed0cd04f8655cf3996ae177036bd5654ef50b2ccd
parent46c16ccbf7957e39b3e2322ff9c633418e906b69 (diff)
downloadlibusb-5e6cff30dc0773c83c0eddc62beb3700c94379ad.tar.gz
Linux: Fix endian handling for usbfs/sysfs
usbfs endian-swaps, sysfs doesn't, not the other way around. This fixes configurator descriptors in big-endian systems when using sysfs. usbfs is untested. Signed-off-by: Hector Martin <hector@marcansoft.com>
-rw-r--r--libusb/os/linux_usbfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c
index d0db7e2..ed1ce13 100644
--- a/libusb/os/linux_usbfs.c
+++ b/libusb/os/linux_usbfs.c
@@ -484,7 +484,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, 1);
+ r = seek_to_next_config(DEVICE_CTX(dev), fd, 0);
if (r < 0)
return r;
}
@@ -539,7 +539,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, 0);
+ r = seek_to_next_config(ctx, fd, 1);
if (r < 0)
return r;
config_index--;