ports/sysutils/nut/files/patch-drivers_libshut.c
Cy Schubert 637c5b1c84 Fix build with SERIAL option.
PR:		223122
2017-10-20 14:51:35 +00:00

23 lines
609 B
C

--- drivers/libshut.c.orig 2015-12-29 12:08:34 UTC
+++ drivers/libshut.c
@@ -37,6 +37,7 @@
#include "nut_stdint.h" /* for uint8_t, uint16_t, uint32_t */
#include "serial.h"
+#include "libusb.h"
#include "libshut.h"
#include "common.h" /* for xmalloc, upsdebugx prototypes */
@@ -809,10 +810,10 @@ int shut_get_string_simple(int upsfd, int index,
return ret;
if (tbuf[1] != USB_DT_STRING)
- return -EIO;
+ return LIBUSB_ERROR_IO;
if (tbuf[0] > ret)
- return -EFBIG;
+ return LIBUSB_ERROR_OVERFLOW;
/* skip the UTF8 zero'ed high bytes */
for (di = 0, si = 2; si < tbuf[0]; si += 2)