aboutsummaryrefslogtreecommitdiffstats
path: root/src/librtlsdr.c
diff options
context:
space:
mode:
authorHoernchen <la@tfc-server.de>2013-01-12 18:22:45 +0100
committerHoernchen <la@tfc-server.de>2013-01-13 00:31:58 +0100
commit5d2d5a4ae4d26f4f6021126d960681c0d72c1c7f (patch)
tree13f61e1918946382f2bb80ee3ea1d1974d7b6ec5 /src/librtlsdr.c
parentf1ac20c3715001974f477860d8fc00b678921e83 (diff)
more verbose error message if opening the usb device fails
Diffstat (limited to 'src/librtlsdr.c')
-rw-r--r--src/librtlsdr.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/librtlsdr.c b/src/librtlsdr.c
index b0a95d8..e6e3e8d 100644
--- a/src/librtlsdr.c
+++ b/src/librtlsdr.c
@@ -1330,7 +1330,10 @@ int rtlsdr_open(rtlsdr_dev_t **out_dev, uint32_t index)
r = libusb_open(device, &dev->devh);
if (r < 0) {
libusb_free_device_list(list, 1);
- fprintf(stderr, "usb_open error %d\n", r);
+ fprintf(stderr, "usb_open error %s\n", libusb_error_name(r));
+ if(r == LIBUSB_ERROR_ACCESS)
+ fprintf(stderr, "Please fix the device permissions, e.g. "
+ "by installing the udev rules file rtl-sdr.rules\n");
goto err;
}
@@ -1338,7 +1341,8 @@ int rtlsdr_open(rtlsdr_dev_t **out_dev, uint32_t index)
r = libusb_claim_interface(dev->devh, 0);
if (r < 0) {
- fprintf(stderr, "usb_claim_interface error %d\n", r);
+ fprintf(stderr, "usb_claim_interface error %s\n",
+ libusb_error_name(r));
goto err;
}