[Nut-upsdev] Too much logging from libusb.c (patch supplied)

Sean Conner sean at conman.org
Mon Apr 19 19:37:47 UTC 2010


  I recently installed NUT 2.4.3 and found that the USB drivers were logging
an insane amount of data to syslog:

usbhid-ups | daemon  debug | Apr 16 18:29:40 | libusb_get_report: No error
usbhid-ups | daemon  debug | Apr 16 18:29:40 | libusb_get_report: No error
usbhid-ups | daemon  debug | Apr 16 18:29:40 | libusb_get_report: No error
usbhid-ups | daemon  debug | Apr 16 18:29:40 | libusb_get_report: No error
usbhid-ups | daemon  debug | Apr 16 18:29:40 | libusb_get_report: No error
usbhid-ups | daemon  debug | Apr 16 18:29:40 | libusb_get_report: No error

(and so on and so on)

I found the location where this is happening and did the following patch:

diff --git a/drivers/libusb.c b/drivers/libusb.c
index 50bfc7f..3eae478 100644
--- a/drivers/libusb.c
+++ b/drivers/libusb.c
@@ -353,7 +353,7 @@ static int libusb_open(usb_dev_handle **udevp, USBDevice_t *curDevice, USBDevice
  */
 static int libusb_strerror(const int ret, const char *desc)
 {
-       if (ret > 0) {
+       if (ret >= 0) {
                return ret;
        }
 

  I've been running that patched version since April 16th, monitoring two
UPSes (APC Back UPS XS 1000 and Cyber Power 1000AVRLCD) with no issues.

  -spc




More information about the Nut-upsdev mailing list