trivial: print the specific error from libusb1

This commit is contained in:
Richard Hughes 2010-05-28 15:15:11 +01:00
parent 758ad538ce
commit 37504601f3

View file

@ -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++) {