summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2010-05-28 15:15:11 +0100
committerRichard Hughes <richard@hughsie.com>2010-05-28 15:15:11 +0100
commit37504601f3fd341406e82ad4ebb8d80c4f2ccd4d (patch)
tree6d4fad49bbdee011c6817ec9264b3dfd5a89bbc4
parent758ad538ce6d4e9b0eee4a9fcad50d1a66756704 (diff)
trivial: print the specific error from libusb1
-rw-r--r--src/linux/up-device-csr.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/linux/up-device-csr.c b/src/linux/up-device-csr.c
index 6c4815f..d4a6486 100644
--- a/src/linux/up-device-csr.c
+++ b/src/linux/up-device-csr.c
@@ -94,13 +94,21 @@ up_device_csr_find_device (UpDeviceCsr *csr)
guint8 bus_num;
guint8 dev_num;
guint i;
+ ssize_t cnt;
egg_debug ("Looking for: [%03d][%03d]", csr->priv->bus_num, csr->priv->dev_num);
/* try to find the right device */
- libusb_get_device_list (csr->priv->ctx, &devices);
+ cnt = libusb_get_device_list (csr->priv->ctx, &devices);
+ if (cnt < 0) {
+/* need to depend on > libusb1-1.0.9 for libusb_strerror()
+ egg_warning ("failed to get device list: %s", libusb_strerror (cnt));
+ */
+ egg_warning ("failed to get device list: %i", cnt);
+ goto out;
+ }
if (devices == NULL) {
- egg_warning ("failed to get any devices");
+ egg_warning ("failed to get device list");
goto out;
}
for (i=0; devices[i] != NULL; i++) {