aboutsummaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linux/cusblinux-1.0.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/linux/cusblinux-1.0.c b/linux/cusblinux-1.0.c
index 4b43b1d..204ef53 100644
--- a/linux/cusblinux-1.0.c
+++ b/linux/cusblinux-1.0.c
@@ -261,8 +261,8 @@ static int getLabelString(CPhidgetHandle phid, struct libusb_device_handle *hand
{
case LIBUSB_ERROR_TIMEOUT: //important case?
default:
- LOG(PHIDGET_LOG_INFO, "libusb_get_string_descriptor failed in CUSBGetDeviceCapabilities with error code: %d while reading label\
- - this probably just means the device doesn't support labels, so this is fine.", len);
+ LOG(PHIDGET_LOG_INFO, "libusb_get_string_descriptor failed in CUSBGetDeviceCapabilities with error code: %d while reading label"\
+ " - this probably just means the device doesn't support labels, so this is fine.", len);
}
phid->label[0]='\0';
return EPHIDGET_OK;
@@ -407,7 +407,7 @@ int CUSBBuildList(CPhidgetList **curList) {
}
}
- ssize_t cnt = libusb_get_device_list(NULL, &list);
+ ssize_t cnt = libusb_get_device_list(libusbContext, &list);
if(cnt < 0)
{
LOG(PHIDGET_LOG_ERROR, "libusb_get_device_list failed with error code: %d", cnt);
@@ -456,7 +456,7 @@ int CUSBBuildList(CPhidgetList **curList) {
//LOG(PHIDGET_LOG_DEBUG,"New Device: %s",(char *)Phid_DeviceName[Phid_Device_Def[i].pdd_did]);
libusb_device_handle *handle = NULL;
- if (libusb_open(device, &handle) == 0)
+ if ((ret = libusb_open(device, &handle)) == 0)
{
if (desc.bcdDevice < 0x100)
phid->deviceVersion = desc.bcdDevice * 100;
@@ -478,7 +478,6 @@ int CUSBBuildList(CPhidgetList **curList) {
if((ret = libusb_get_string_descriptor_ascii(handle, desc.iSerialNumber, string, sizeof(string))) < 0)
{
LOG(PHIDGET_LOG_ERROR, "libusb_get_string_descriptor_ascii failed with error code: %d", ret);
- LOG(PHIDGET_LOG_INFO, "This usually means you need to run as root");
libusb_close(handle);
free(phid);
goto next;
@@ -505,6 +504,8 @@ int CUSBBuildList(CPhidgetList **curList) {
} //if(udev)
else
{
+ LOG(PHIDGET_LOG_WARNING, "libusb_open failed with error code: %d", ret);
+ LOG(PHIDGET_LOG_INFO, "This usually means you need to run as root, or install the udev rules.");
free(phid);
libusb_close(handle);
}
@@ -537,7 +538,7 @@ int CUSBOpenHandle(CPhidgetHandle phid)
int i, j,ret = EPHIDGET_OK;
libusb_device **list = NULL;
- ssize_t cnt = libusb_get_device_list(NULL, &list);
+ ssize_t cnt = libusb_get_device_list(libusbContext, &list);
if(cnt < 0)
{
@@ -565,7 +566,7 @@ int CUSBOpenHandle(CPhidgetHandle phid)
/* the vend/prod matches! */
libusb_device_handle *handle = NULL;
- if (libusb_open(device, &handle) == 0)
+ if ((ret = libusb_open(device, &handle)) == 0)
{
serial = -1;
if (desc.iSerialNumber) {
@@ -573,7 +574,6 @@ int CUSBOpenHandle(CPhidgetHandle phid)
if((ret = libusb_get_string_descriptor_ascii(handle, desc.iSerialNumber, string, sizeof(string))) < 0)
{
LOG(PHIDGET_LOG_WARNING, "libusb_get_string_descriptor_ascii failed with error code: %d", ret);
- LOG(PHIDGET_LOG_INFO, "This usually means you need to run as root");
libusb_close(handle);
goto next;
}
@@ -643,8 +643,9 @@ int CUSBOpenHandle(CPhidgetHandle phid)
} /* udev open */
else
{
+ LOG(PHIDGET_LOG_WARNING, "libusb_open failed with error code: %d", ret);
+ LOG(PHIDGET_LOG_INFO, "This usually means you need to run as root, or install the udev rules.");
libusb_close(handle);
- LOG(PHIDGET_LOG_WARNING, "usb_open failed - bad permission or what?");
}
} /* vendor/product match */
} /* deviceID matches in table */
?h=debian/0%2bgit20141009.d26b627-1'>debian/0+git20141009.d26b627-1Jonathan McCrohan1-2/+2 2014-10-20Fix up packaging to account for move to DVBv5Jonathan McCrohan2-2/+6 2014-10-20delete d/dtv-scan-files.install; Upstream now supplies a MakefileJonathan McCrohan2-4/+1 2014-10-15d/control: update Standards Version to 3.9.6Jonathan McCrohan2-1/+3 2014-10-15d/control: add Build-Depends on dvb-toolsJonathan McCrohan2-1/+2 2014-10-15New Upstream Snapshot (commit d26b627)Jonathan McCrohan1-0/+10 2014-10-15Imported Upstream version 0+git20141009.d26b627upstream/0+git20141009.d26b627Jonathan McCrohan2010-11120/+159271 2014-07-23Release 0+git20140611.14bd6c7-1debian/0+git20140611.14bd6c7-1Jonathan McCrohan1-2/+2 2014-07-23New Upstream Snapshot (commit 14bd6c7)Jonathan McCrohan1-2/+3 2014-07-23Imported Upstream version 0+git20140611.14bd6c7upstream/0+git20140611.14bd6c7Jonathan McCrohan7-11/+60 2014-05-13New Upstream Snapshot (commit 1246b27)Jonathan McCrohan1-0/+6 2014-05-13Imported Upstream version 0+git20140512.1246b27upstream/0+git20140512.1246b27Jonathan McCrohan391-301/+3983 2014-04-05Release 0+git20140326.cfc2975-1debian/0+git20140326.cfc2975-1Jonathan McCrohan1-2/+2 2014-04-05d/control: update Homepage (upstream has moved from Gitweb to cgit)Jonathan McCrohan2-1/+2 2014-04-05New Upstream Snapshot (commit cfc2975)Jonathan McCrohan1-0/+6 2014-04-05Imported Upstream version 0+git20140326.cfc2975upstream/0+git20140326.cfc2975Jonathan McCrohan118-656/+877 2014-01-16Release 0+git20140107.1850cf8-1debian/0+git20140107.1850cf8-1Jonathan McCrohan1-2/+2 2014-01-16Update Standards Version to 3.9.5Jonathan McCrohan2-1/+9