[Nut-upsdev] PowerWare USB debug messages

Charles Lepple clepple at gmail.com
Fri Jul 10 02:51:10 UTC 2009

Earlier this year, I added a patch to my local NUT tree to
additionally print the value of usb_strerror() if usb_clear_halt()

(Ignore the commented-out goto.)

Since these messages are at the LOG_ERR level, should we add
usb_strerror() to all of the calls in nut_usb.c?

diff --git a/drivers/nut_usb.c b/drivers/nut_usb.c
index 494a1fa..4ca2691 100644
--- a/drivers/nut_usb.c
+++ b/drivers/nut_usb.c
@@ -165,8 +165,8 @@ usb_dev_handle *nutusb_open(const char *port)

        if (usb_clear_halt(dev_h, 0x81) < 0)
-           upslogx(LOG_ERR, "Can't reset POWERWARE USB endpoint");
-           goto errout;
+         upslogx(LOG_ERR, "Can't reset POWERWARE USB endpoint: %s",
+         /* goto errout; */

        return dev_h;

- Charles Lepple

More information about the Nut-upsdev mailing list