openbsd-ports/sysutils/nut/patches/patch-drivers_usbhid-ups_c

23 lines
894 B
Plaintext

$OpenBSD: patch-drivers_usbhid-ups_c,v 1.5 2012/08/09 12:05:16 sthen Exp $
--- drivers/usbhid-ups.c.orig Tue Jul 31 18:38:59 2012
+++ drivers/usbhid-ups.c Thu Aug 9 01:35:52 2012
@@ -933,7 +933,7 @@ void upsdrv_initups(void)
regular expression (USB) or device_path (SHUT) */
ret = comm_driver->open(&udev, &curDevice, subdriver_matcher, &callback);
if (ret < 1)
- fatalx(EXIT_FAILURE, "No matching HID UPS found");
+ fatalx(EXIT_FAILURE, "No matching HID UPS found - check permissions on /dev/ugen* and /dev/usb*");
hd = &curDevice;
@@ -1261,7 +1261,9 @@ static bool_t hid_ups_walk(walkmode_t mode)
case -ETIMEDOUT: /* Connection timed out */
case -EOVERFLOW: /* Value too large for defined data type */
+#ifdef EPROTO
case -EPROTO: /* Protocol error */
+#endif
case -EPIPE: /* Broken pipe */
default:
/* Don't know what happened, try again later... */