Citeren Sean Conner <[email protected]>:

  Well, the comment above that function reads:

/*
 * Error handler for usb_get/set_* functions. Return value > 0 success,
* 0 unknown or temporary failure (ignored), < 0 permanent failure (reconnect)
 */

And this is exactly what happens.

You might want to have a custom message for the 0 case, as usb_strerror()
(which I suppose is a wrapper for strerror(), but I haven't checked) just
returns "No error" for a value of 0, which to me, is misleading (and the
comment says it's ignored anyway, so either the code is wrong, or the
comment).  All I saw logged were countless "No error" messages.

You misunderstood the 'ignored' part here. The driver just doesn't know what to do to resolve the error condition (and most likely can't do anything about it anyway). That still doesn't make it a 'non-error' condition and still may result in abnormal behavior that we want to be informed about. Depending on the HID path that returns this error, this may be an insignificant problem (reading serial number of the device) or a critical one (line/battery status). There is no way to tell at this point.

The problem is I'm monitoring two UPSes via USB and the logging
information is insufficient to determine which UPS is giving the bogus
information.

The driver should also log the PID in the log message (at least, that's what it is configured to do so). If you're running multiple drivers, you should still be able to tell them apart by the PID.

Best regards, Arjen
--
Please keep list traffic on the list


_______________________________________________
Nut-upsdev mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev

Reply via email to