Index: head/sysutils/nut/Makefile =================================================================== --- head/sysutils/nut/Makefile (revision 555090) +++ head/sysutils/nut/Makefile (revision 555091) @@ -1,197 +1,197 @@ # Created by: Boris Popov # $FreeBSD$ PORTNAME= nut PORTVERSION= 2.7.4 -PORTREVISION= 17 +PORTREVISION= 18 CATEGORIES= sysutils MASTER_SITES= http://www.networkupstools.org/source/${PORTVERSION:R}/ DISTFILES= ${DISTNAME}${EXTRACT_SUFX} EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER= cy@FreeBSD.org COMMENT= Network UPS Tools GNU_CONFIGURE= yes USE_LDCONFIG= yes USES= autoreconf gmake pkgconfig libtool NUT_USER?= uucp NUT_GROUP?= uucp STATEDIR?= /var/db/nut PLIST_SUB+= NUT_USER=${NUT_USER} PLIST_SUB+= NUT_GROUP=${NUT_GROUP} OPTIONS_DEFAULT=SERIAL USB SNMP NEON IPMI_OFF SSL_OFF OPTIONS_DEFINE= SERIAL USB SNMP NEON PDU CGI BASH AVAHI DOCS OPTIONS_SINGLE= IPMI SSL OPTIONS_SINGLE_IPMI= IPMI_OFF IPMIPSU FREEIPMI OPTIONS_SINGLE_SSL= SSL_OFF OPENSSL NSS SERIAL_DESC= SERIAL support USB_DESC= USB support SNMP_DESC= SNMP support NEON_DESC= NEON XML/HTTP support PDU_DESC= Powerman PDU support CGI_DESC= Web CGI interface BASH_DESC= Bash Completion support AVAHI_DESC= Avahi support IPMI_OFF_DESC= No IPMI support FREEIPMI_DESC= freeipmi support IPMIPSU_DESC= Use nut-ipmipsu support (experimental) SSL_OFF_DESC= No SSL support USE_RC_SUBR= nut nut_upsmon nut_upslog SUB_LIST+= STATEDIR=${STATEDIR} PLIST_SUB+= STATEDIR=${STATEDIR} PORTDOCS= * .include CONFIGURE_ARGS= --sysconfdir=${PREFIX}/etc/nut \ --program-transform-name="" \ --localstatedir=${STATEDIR} \ --datadir=${PREFIX}/etc/nut \ --with-devd-dir=${PREFIX}/etc/devd \ --with-drvpath=${PREFIX}/libexec/nut \ --with-statepath=${STATEDIR} \ --with-altpidpath=${STATEDIR} \ --with-pidpath=${STATEDIR} \ --with-pkgconfig-dir=${PREFIX}/libdata/pkgconfig \ --with-user=${NUT_USER} \ --with-group=${NUT_GROUP} \ --with-dev .if ${PORT_OPTIONS:MCGI} LIB_DEPENDS+= libgd.so:graphics/gd CGIDIR?= ${PREFIX}/www/cgi-bin/${PORTNAME} CGIDIR_REL?= ${CGIDIR:S,^${PREFIX}/,,} CONFIGURE_ARGS+= --with-cgi --with-cgipath=${CGIDIR} \ --with-htmlpath=${WWWDIR} \ --with-gd-includes=-I${LOCALBASE}/include \ --with-gd-libs="-L${LOCALBASE}/lib -lgd" PLIST_SUB+= NUT_CGI="" PLIST_SUB+= CGIDIR="${CGIDIR_REL}" PLIST_SUB+= CGIETCDIR="etc/nut/" .else CONFIGURE_ARGS+= --without-cgi PLIST_SUB+= NUT_CGI="@comment " .endif .if ${PORT_OPTIONS:MSERIAL} CONFIGURE_ARGS+= --with-serial PLIST_SUB+= NUT_SERIAL="" .else CONFIGURE_ARGS+= --without-serial PLIST_SUB+= NUT_SERIAL="@comment " .endif .if ${PORT_OPTIONS:MUSB} #EXTRA_PATCHES= ${FILESDIR}/extra-patch-m4_nut_check_libusb.m4 CONFIGURE_ARGS+= --with-usb=auto PLIST_SUB+= NUT_USB="" .else CONFIGURE_ARGS+= --without-usb PLIST_SUB+= NUT_USB="@comment " .endif .if ${PORT_OPTIONS:MSNMP} LIB_DEPENDS+= libnetsnmp.so:net-mgmt/net-snmp CONFIGURE_ARGS+= --with-snmp PLIST_SUB+= NUT_SNMP="" .else CONFIGURE_ARGS+= --without-snmp PLIST_SUB+= NUT_SNMP="@comment " .endif .if ${PORT_OPTIONS:MNEON} LIB_DEPENDS+= libneon.so:www/neon CONFIGURE_ARGS+= --with-neon PLIST_SUB+= NUT_NEON="" .else CONFIGURE_ARGS+= --without-neon CONFIGURE_ARGS+= --disable-neon PLIST_SUB+= NUT_NEON="@comment " .endif .if ${PORT_OPTIONS:MPDU} LIB_DEPENDS+= libpowerman.so:sysutils/powerman CONFIGURE_ARGS+= --with-powerman PLIST_SUB+= NUT_PDU="" .else CONFIGURE_ARGS+= --without-powerman PLIST_SUB+= NUT_PDU="@comment " .endif .if ${PORT_OPTIONS:MBASH} BUILD_DEPENDS+= ${LOCALBASE}/share/bash-completion/bash_completion.sh:shells/bash-completion RUN_DEPENDS+= ${LOCALBASE}/share/bash-completion/bash_completion.sh:shells/bash-completion PLIST_SUB+= BASH="" .else PLIST_SUB+= BASH="@comment " .endif .if ${PORT_OPTIONS:MAVAHI} BUILD_DEPENDS+= ${LOCALBASE}/include/avahi-ui/avahi-ui.h:net/avahi-header BUILD_DEPENDS+= avahi-daemon:net/avahi-app RUN_DEPENDS+= avahi-daemon:net/avahi-app CONFIGURE_ARGS+= --with-avahi .else CONFIGURE_ARGS+= --without-avahi .endif .if ${PORT_OPTIONS:MFREEIPMI} LIB_DEPENDS+= libfreeipmi.so:sysutils/freeipmi CONFIGURE_ARGS+= --with-freeipmi PLIST_SUB+= NUT_FREEIPMI="" .else CONFIGURE_ARGS+= --without-freeipmi PLIST_SUB+= NUT_FREEIPMI="@comment " .endif .if ${PORT_OPTIONS:MIPMIPSU} LIB_DEPENDS+= libfreeipmi.so:sysutils/freeipmi CONFIGURE_ARGS+= --with-ipmi PLIST_SUB+= NUT_IPMIPSU="" .else CONFIGURE_ARGS+= --without-ipmi PLIST_SUB+= NUT_IPMIPSU="@comment " .endif .if ${PORT_OPTIONS:MOPENSSL} USES+= ssl CONFIGURE_ARGS+= --with-openssl .elif ${PORT_OPTIONS:MNSS} LIB_DEPENDS= libnss3.so:security/nss CONFIGURE_ARGS+= --with-nss .else CONFIGURE_ARGS+= --without-openssl --without-ssl .endif pre-install: @${MKDIR} ${STAGEDIR}${PREFIX}/libexec/nut @${REINPLACE_CMD} -e 's/device-name\*/cdev/g' ${WRKSRC}/scripts/devd/nut-usb.conf post-install: @${MKDIR} ${STAGEDIR}${STATEDIR} @${MKDIR} ${STAGEDIR}${PREFIX}/etc/syslog.d .if ${PORT_OPTIONS:MBASH} @${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d/ ${INSTALL_DATA} ${WRKSRC}/scripts/misc/nut.bash_completion ${STAGEDIR}${PREFIX}/etc/bash_completion.d/ .endif .if ${PORT_OPTIONS:MDOCS} @${MKDIR} ${STAGEDIR}${DOCSDIR}/cables ${INSTALL_DATA} ${WRKSRC}/docs/cables/*.txt ${STAGEDIR}${DOCSDIR}/cables ${INSTALL_DATA} ${WRKSRC}/docs/*.txt ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/docs/FAQ.txt ${STAGEDIR}${DOCSDIR} .for file in AUTHORS COPYING ChangeLog INSTALL MAINTAINERS NEWS README UPGRADING ${INSTALL_DATA} ${WRKSRC}/${file} ${STAGEDIR}${DOCSDIR} .endfor .endif @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${PATCHDIR}/nut.syslog ${STAGEDIR}${EXAMPLESDIR}/syslog.sample ${INSTALL_DATA} ${PATCHDIR}/nut.newsyslog ${STAGEDIR}${EXAMPLESDIR}/newsyslog.sample ${MKDIR} ${STAGEDIR}/var/log/nut .include Index: head/sysutils/nut/files/patch-drivers_tripplite__usb.c =================================================================== --- head/sysutils/nut/files/patch-drivers_tripplite__usb.c (revision 555090) +++ head/sysutils/nut/files/patch-drivers_tripplite__usb.c (nonexistent) @@ -1,20 +0,0 @@ ---- drivers/tripplite_usb.c.orig 2015-12-29 12:08:34 UTC -+++ drivers/tripplite_usb.c -@@ -499,7 +499,7 @@ void usb_comm_fail(int res, const char *msg) - static int try = 0; - - switch(res) { -- case -EBUSY: -+ case LIBUSB_ERROR_BUSY: - upslogx(LOG_WARNING, "%s: Device claimed by another process", msg); - fatalx(EXIT_FAILURE, "Terminating: EBUSY"); - break; -@@ -907,7 +907,7 @@ void upsdrv_initinfo(void) - if(tl_model != TRIPP_LITE_SMARTPRO ) { - ret = send_cmd(w_msg, sizeof(w_msg), w_value, sizeof(w_value)-1); - if(ret <= 0) { -- if(ret == -EPIPE) { -+ if(ret == LIBUSB_ERROR_PIPE) { - fatalx(EXIT_FAILURE, "Could not reset watchdog. Please check and" - "see if usbhid-ups(8) works with this UPS."); - } else { Property changes on: head/sysutils/nut/files/patch-drivers_tripplite__usb.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/nut/files/patch-drivers_blazer__usb.c =================================================================== --- head/sysutils/nut/files/patch-drivers_blazer__usb.c (revision 555090) +++ head/sysutils/nut/files/patch-drivers_blazer__usb.c (nonexistent) @@ -1,79 +0,0 @@ ---- drivers/blazer_usb.c.orig 2015-12-29 12:08:34 UTC -+++ drivers/blazer_usb.c -@@ -118,9 +118,9 @@ static int phoenix_command(const char *cmd, char *buf, - */ - switch (ret) - { -- case -EPIPE: /* Broken pipe */ -+ case LIBUSB_ERROR_PIPE: /* Broken pipe */ - usb_clear_halt(udev, 0x81); -- case -ETIMEDOUT: /* Connection timed out */ -+ case LIBUSB_ERROR_TIMEOUT: /* Connection timed out */ - break; - } - -@@ -188,7 +188,7 @@ static int ippon_command(const char *cmd, char *buf, s - 0x09, 0x2, 0, &tmp[i], 8, 1000); - - if (ret <= 0) { -- upsdebugx(3, "send: %s", (ret != -ETIMEDOUT) ? usb_strerror() : "Connection timed out"); -+ upsdebugx(3, "send: %s", (ret != LIBUSB_ERROR_TIMEOUT) ? usb_strerror() : "Connection timed out"); - return ret; - } - } -@@ -203,7 +203,7 @@ static int ippon_command(const char *cmd, char *buf, s - * will happen after successfully writing a command to the UPS) - */ - if (ret <= 0) { -- upsdebugx(3, "read: %s", (ret != -ETIMEDOUT) ? usb_strerror() : "Connection timed out"); -+ upsdebugx(3, "read: %s", (ret != LIBUSB_ERROR_TIMEOUT) ? usb_strerror() : "Connection timed out"); - return ret; - } - -@@ -423,38 +423,28 @@ int blazer_command(const char *cmd, char *buf, size_t - - switch (ret) - { -- case -EBUSY: /* Device or resource busy */ -+ case LIBUSB_ERROR_BUSY: /* Device or resource busy */ - fatal_with_errno(EXIT_FAILURE, "Got disconnected by another driver"); - -- case -EPERM: /* Operation not permitted */ -- fatal_with_errno(EXIT_FAILURE, "Permissions problem"); -- -- case -EPIPE: /* Broken pipe */ -+ case LIBUSB_ERROR_PIPE: /* Broken pipe */ - if (usb_clear_halt(udev, 0x81) == 0) { - upsdebugx(1, "Stall condition cleared"); - break; - } --#ifdef ETIME -- case -ETIME: /* Timer expired */ --#endif - if (usb_reset(udev) == 0) { - upsdebugx(1, "Device reset handled"); - } -- case -ENODEV: /* No such device */ -- case -EACCES: /* Permission denied */ -- case -EIO: /* I/O error */ -- case -ENXIO: /* No such device or address */ -- case -ENOENT: /* No such file or directory */ -+ case LIBUSB_ERROR_NO_DEVICE: /* No such device */ -+ case LIBUSB_ERROR_ACCESS: /* Permission denied */ -+ case LIBUSB_ERROR_IO: /* I/O error */ -+ case LIBUSB_ERROR_NOT_FOUND: /* No such file or directory */ - /* Uh oh, got to reconnect! */ - usb->close(udev); - udev = NULL; - break; - -- case -ETIMEDOUT: /* Connection timed out */ -- case -EOVERFLOW: /* Value too large for defined data type */ --#ifdef EPROTO -- case -EPROTO: /* Protocol error */ --#endif -+ case LIBUSB_ERROR_TIMEOUT: /* Connection timed out */ -+ case LIBUSB_ERROR_OVERFLOW: /* Value too large for defined data type */ - default: - break; - } Property changes on: head/sysutils/nut/files/patch-drivers_blazer__usb.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/nut/files/patch-drivers_riello__usb.c =================================================================== --- head/sysutils/nut/files/patch-drivers_riello__usb.c (revision 555090) +++ head/sysutils/nut/files/patch-drivers_riello__usb.c (nonexistent) @@ -1,53 +0,0 @@ ---- drivers/riello_usb.c.orig 2015-12-29 12:08:34 UTC -+++ drivers/riello_usb.c -@@ -346,42 +346,28 @@ int riello_command(uint8_t *cmd, uint8_t *buf, uint16_ - - switch (ret) - { -- case -EBUSY: /* Device or resource busy */ -+ case LIBUSB_ERROR_BUSY: /* Device or resource busy */ - fatal_with_errno(EXIT_FAILURE, "Got disconnected by another driver"); - -- case -EPERM: /* Operation not permitted */ -- fatal_with_errno(EXIT_FAILURE, "Permissions problem"); -- -- case -EPIPE: /* Broken pipe */ -+ case LIBUSB_ERROR_PIPE: /* Broken pipe */ - if (usb_clear_halt(udev, 0x81) == 0) { - upsdebugx(1, "Stall condition cleared"); - break; - } --#ifdef ETIME -- case -ETIME: /* Timer expired */ --#endif - if (usb_reset(udev) == 0) { - upsdebugx(1, "Device reset handled"); - } -- case -ENODEV: /* No such device */ -- case -EACCES: /* Permission denied */ -- case -EIO: /* I/O error */ -- case -ENXIO: /* No such device or address */ -- case -ENOENT: /* No such file or directory */ -+ case LIBUSB_ERROR_NO_DEVICE: /* No such device */ -+ case LIBUSB_ERROR_ACCESS: /* Permission denied */ -+ case LIBUSB_ERROR_IO: /* I/O error */ -+ case LIBUSB_ERROR_NOT_FOUND: /* No such file or directory */ - /* Uh oh, got to reconnect! */ - usb->close(udev); - udev = NULL; - break; - -- case -ETIMEDOUT: /* Connection timed out */ -- upsdebugx (3, "riello_command err: Resource temporarily unavailable"); -- -- -- case -EOVERFLOW: /* Value too large for defined data type */ --#ifdef EPROTO -- case -EPROTO: /* Protocol error */ --#endif -- break; -+ case LIBUSB_ERROR_TIMEOUT: /* Connection timed out */ -+ case LIBUSB_ERROR_OVERFLOW: /* Value too large for defined data type */ - default: - break; - } Property changes on: head/sysutils/nut/files/patch-drivers_riello__usb.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/nut/files/patch-drivers_libshut.c =================================================================== --- head/sysutils/nut/files/patch-drivers_libshut.c (revision 555090) +++ head/sysutils/nut/files/patch-drivers_libshut.c (nonexistent) @@ -1,23 +0,0 @@ ---- 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) Property changes on: head/sysutils/nut/files/patch-drivers_libshut.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/nut/files/patch-drivers_libusb.c =================================================================== --- head/sysutils/nut/files/patch-drivers_libusb.c (revision 555090) +++ head/sysutils/nut/files/patch-drivers_libusb.c (nonexistent) @@ -1,65 +0,0 @@ ---- drivers/libusb.c.orig 2015-12-29 12:08:34 UTC -+++ drivers/libusb.c -@@ -428,26 +428,21 @@ static int libusb_strerror(const int ret, const char * - - switch(ret) - { -- case -EBUSY: /* Device or resource busy */ -- case -EPERM: /* Operation not permitted */ -- case -ENODEV: /* No such device */ -- case -EACCES: /* Permission denied */ -- case -EIO: /* I/O error */ -- case -ENXIO: /* No such device or address */ -- case -ENOENT: /* No such file or directory */ -- case -EPIPE: /* Broken pipe */ -- case -ENOSYS: /* Function not implemented */ -+ case LIBUSB_ERROR_BUSY: /* Device or resource busy */ -+ case LIBUSB_ERROR_NO_DEVICE: /* No such device */ -+ case LIBUSB_ERROR_ACCESS: /* Permission denied */ -+ case LIBUSB_ERROR_IO: /* I/O error */ -+ case LIBUSB_ERROR_NOT_FOUND: /* No such file or directory */ -+ case LIBUSB_ERROR_PIPE: /* Broken pipe */ -+ case LIBUSB_ERROR_NOT_SUPPORTED: /* Function not implemented */ - upslogx(LOG_DEBUG, "%s: %s", desc, usb_strerror()); - return ret; - -- case -ETIMEDOUT: /* Connection timed out */ -+ case LIBUSB_ERROR_TIMEOUT: /* Connection timed out */ - upsdebugx(2, "%s: Connection timed out", desc); - return 0; - -- case -EOVERFLOW: /* Value too large for defined data type */ --#ifdef EPROTO -- case -EPROTO: /* Protocol error */ --#endif -+ case LIBUSB_ERROR_OVERFLOW: /* Value too large for defined data type */ - upsdebugx(2, "%s: %s", desc, usb_strerror()); - return 0; - -@@ -478,7 +473,7 @@ static int libusb_get_report(usb_dev_handle *udev, int - 0, raw_buf, ReportSize, USB_TIMEOUT); - - /* Ignore "protocol stall" (for unsupported request) on control endpoint */ -- if (ret == -EPIPE) { -+ if (ret == LIBUSB_ERROR_PIPE) { - return 0; - } - -@@ -500,7 +495,7 @@ static int libusb_set_report(usb_dev_handle *udev, int - 0, raw_buf, ReportSize, USB_TIMEOUT); - - /* Ignore "protocol stall" (for unsupported request) on control endpoint */ -- if (ret == -EPIPE) { -+ if (ret == LIBUSB_ERROR_PIPE) { - return 0; - } - -@@ -532,7 +527,7 @@ static int libusb_get_interrupt(usb_dev_handle *udev, - ret = usb_interrupt_read(udev, 0x81, (char *)buf, bufsize, timeout); - - /* Clear stall condition */ -- if (ret == -EPIPE) { -+ if (ret == LIBUSB_ERROR_PIPE) { - ret = usb_clear_halt(udev, 0x81); - } - Property changes on: head/sysutils/nut/files/patch-drivers_libusb.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/nut/files/patch-drivers_usbhid-ups.c =================================================================== --- head/sysutils/nut/files/patch-drivers_usbhid-ups.c (revision 555090) +++ head/sysutils/nut/files/patch-drivers_usbhid-ups.c (nonexistent) @@ -1,74 +0,0 @@ ---- drivers/usbhid-ups.c.orig 2015-12-29 12:08:34 UTC -+++ drivers/usbhid-ups.c -@@ -30,6 +30,7 @@ - #define DRIVER_VERSION "0.41" - - #include "main.h" -+#include "libusb.h" - #include "libhid.h" - #include "usbhid-ups.h" - #include "hidparser.h" -@@ -790,22 +790,14 @@ void upsdrv_updateinfo(void) - /* Get HID notifications on Interrupt pipe first */ - if (use_interrupt_pipe == TRUE) { - evtCount = HIDGetEvents(udev, event, MAX_EVENT_NUM); -- switch (evtCount) -- { -- case -EBUSY: /* Device or resource busy */ -- upslog_with_errno(LOG_CRIT, "Got disconnected by another driver"); -- case -EPERM: /* Operation not permitted */ -- case -ENODEV: /* No such device */ -- case -EACCES: /* Permission denied */ -- case -EIO: /* I/O error */ -- case -ENXIO: /* No such device or address */ -- case -ENOENT: /* No such file or directory */ -+ if (evtCount < 0) { -+ if (evtCount == LIBUSB_ERROR_BUSY) { -+ upslog_with_errno(LOG_CRIT, "Got disconnected by another driver"); -+ } - /* Uh oh, got to reconnect! */ - hd = NULL; -- return; -- default: -+ } else { - upsdebugx(1, "Got %i HID objects...", (evtCount >= 0) ? evtCount : 0); -- break; - } - } else { - evtCount = 0; -@@ -1280,14 +1272,12 @@ static bool_t hid_ups_walk(walkmode_t mode) - - switch (retcode) - { -- case -EBUSY: /* Device or resource busy */ -+ case LIBUSB_ERROR_BUSY: /* Device or resource busy */ - upslog_with_errno(LOG_CRIT, "Got disconnected by another driver"); -- case -EPERM: /* Operation not permitted */ -- case -ENODEV: /* No such device */ -- case -EACCES: /* Permission denied */ -- case -EIO: /* I/O error */ -- case -ENXIO: /* No such device or address */ -- case -ENOENT: /* No such file or directory */ -+ case LIBUSB_ERROR_NO_DEVICE: /* No such device */ -+ case LIBUSB_ERROR_ACCESS: /* Permission denied */ -+ case LIBUSB_ERROR_IO: /* I/O error */ -+ case LIBUSB_ERROR_NOT_FOUND: /* No such file or directory */ - /* Uh oh, got to reconnect! */ - hd = NULL; - return FALSE; -@@ -1298,12 +1288,9 @@ static bool_t hid_ups_walk(walkmode_t mode) - case 0: - continue; - -- 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 */ -+ case LIBUSB_ERROR_TIMEOUT: /* Connection timed out */ -+ case LIBUSB_ERROR_OVERFLOW: /* Value too large for defined data type */ -+ case LIBUSB_ERROR_PIPE: /* Broken pipe */ - default: - /* Don't know what happened, try again later... */ - continue; Property changes on: head/sysutils/nut/files/patch-drivers_usbhid-ups.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/nut/files/patch-drivers_libusb.h =================================================================== --- head/sysutils/nut/files/patch-drivers_libusb.h (revision 555090) +++ head/sysutils/nut/files/patch-drivers_libusb.h (nonexistent) @@ -1,27 +0,0 @@ ---- drivers/libusb.h.orig 2015-12-29 12:08:34 UTC -+++ drivers/libusb.h -@@ -36,6 +36,24 @@ - - #include /* libusb header file */ - -+/* libusb 1.0 errors used by FreeBSD */ -+enum libusb_error { -+ LIBUSB_SUCCESS = 0, -+ LIBUSB_ERROR_IO = -1, -+ LIBUSB_ERROR_INVALID_PARAM = -2, -+ LIBUSB_ERROR_ACCESS = -3, -+ LIBUSB_ERROR_NO_DEVICE = -4, -+ LIBUSB_ERROR_NOT_FOUND = -5, -+ LIBUSB_ERROR_BUSY = -6, -+ LIBUSB_ERROR_TIMEOUT = -7, -+ LIBUSB_ERROR_OVERFLOW = -8, -+ LIBUSB_ERROR_PIPE = -9, -+ LIBUSB_ERROR_INTERRUPTED = -10, -+ LIBUSB_ERROR_NO_MEM = -11, -+ LIBUSB_ERROR_NOT_SUPPORTED = -12, -+ LIBUSB_ERROR_OTHER = -99, -+}; -+ - extern upsdrv_info_t comm_upsdrv_info; - - /*! Property changes on: head/sysutils/nut/files/patch-drivers_libusb.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/nut/files/patch-drivers_nutdrv__qx.c =================================================================== --- head/sysutils/nut/files/patch-drivers_nutdrv__qx.c (revision 555090) +++ head/sysutils/nut/files/patch-drivers_nutdrv__qx.c (nonexistent) @@ -1,79 +0,0 @@ ---- drivers/nutdrv_qx.c.orig 2016-03-08 12:01:11 UTC -+++ drivers/nutdrv_qx.c -@@ -561,9 +561,9 @@ static int phoenix_command(const char *cmd, char *buf, - * In order to read correct replies we need to flush the output buffers of the converter until we get no more data (ie, it times out). */ - switch (ret) - { -- case -EPIPE: /* Broken pipe */ -+ case LIBUSB_ERROR_PIPE: /* Broken pipe */ - usb_clear_halt(udev, 0x81); -- case -ETIMEDOUT: /* Connection timed out */ -+ case LIBUSB_ERROR_TIMEOUT: /* Connection timed out */ - break; - } - -@@ -635,7 +635,7 @@ static int ippon_command(const char *cmd, char *buf, s - ret = usb_control_msg(udev, USB_ENDPOINT_OUT + USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x09, 0x2, 0, &tmp[i], 8, 1000); - - if (ret <= 0) { -- upsdebugx(3, "send: %s (%d)", (ret != -ETIMEDOUT) ? usb_strerror() : "Connection timed out", ret); -+ upsdebugx(3, "send: %s (%d)", (ret != LIBUSB_ERROR_TIMEOUT) ? usb_strerror() : "Connection timed out", ret); - return ret; - } - -@@ -648,7 +648,7 @@ static int ippon_command(const char *cmd, char *buf, s - - /* Any errors here mean that we are unable to read a reply (which will happen after successfully writing a command to the UPS) */ - if (ret <= 0) { -- upsdebugx(3, "read: %s (%d)", (ret != -ETIMEDOUT) ? usb_strerror() : "Connection timed out", ret); -+ upsdebugx(3, "read: %s (%d)", (ret != LIBUSB_ERROR_TIMEOUT) ? usb_strerror() : "Connection timed out", ret); - return ret; - } - -@@ -2124,38 +2124,28 @@ static int qx_command(const char *cmd, char *buf, size - - switch (ret) - { -- case -EBUSY: /* Device or resource busy */ -+ case LIBUSB_ERROR_BUSY: /* Device or resource busy */ - fatal_with_errno(EXIT_FAILURE, "Got disconnected by another driver"); - -- case -EPERM: /* Operation not permitted */ -- fatal_with_errno(EXIT_FAILURE, "Permissions problem"); -- -- case -EPIPE: /* Broken pipe */ -+ case LIBUSB_ERROR_PIPE: /* Broken pipe */ - if (usb_clear_halt(udev, 0x81) == 0) { - upsdebugx(1, "Stall condition cleared"); - break; - } -- #ifdef ETIME -- case -ETIME: /* Timer expired */ -- #endif /* ETIME */ - if (usb_reset(udev) == 0) { - upsdebugx(1, "Device reset handled"); - } -- case -ENODEV: /* No such device */ -- case -EACCES: /* Permission denied */ -- case -EIO: /* I/O error */ -- case -ENXIO: /* No such device or address */ -- case -ENOENT: /* No such file or directory */ -+ case LIBUSB_ERROR_NO_DEVICE: /* No such device */ -+ case LIBUSB_ERROR_ACCESS: /* Permission denied */ -+ case LIBUSB_ERROR_IO: /* I/O error */ -+ case LIBUSB_ERROR_NOT_FOUND: /* No such file or directory */ - /* Uh oh, got to reconnect! */ - usb->close(udev); - udev = NULL; - break; - -- case -ETIMEDOUT: /* Connection timed out */ -- case -EOVERFLOW: /* Value too large for defined data type */ --#ifdef EPROTO -- case -EPROTO: /* Protocol error */ --#endif -+ case LIBUSB_ERROR_TIMEOUT: /* Connection timed out */ -+ case LIBUSB_ERROR_OVERFLOW: /* Value too large for defined data type */ - default: - break; - } Property changes on: head/sysutils/nut/files/patch-drivers_nutdrv__qx.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/nut/files/patch-drivers_main.h =================================================================== --- head/sysutils/nut/files/patch-drivers_main.h (nonexistent) +++ head/sysutils/nut/files/patch-drivers_main.h (revision 555091) @@ -0,0 +1,10 @@ +--- drivers/main.h.orig 2015-12-29 04:08:34.000000000 -0800 ++++ drivers/main.h 2020-11-13 23:40:47.007315000 -0800 +@@ -1,6 +1,7 @@ + #ifndef MAIN_H + #define MAIN_H + ++#include + #include "common.h" + #include "upsconf.h" + #include "dstate.h" Property changes on: head/sysutils/nut/files/patch-drivers_main.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/sysutils/nut-devel/Makefile =================================================================== --- head/sysutils/nut-devel/Makefile (revision 555090) +++ head/sysutils/nut-devel/Makefile (revision 555091) @@ -1,215 +1,215 @@ # Created by: Boris Popov # $FreeBSD$ PORTNAME= nut PORTVERSION= ${NUT_COMMIT_DATE} -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils PKGNAMESUFFIX= -devel # MASTER_SITES= http://www.networkupstools.org/source/${PORTVERSION:R}/ # DISTFILES= ${DISTNAME}${EXTRACT_SUFX} # EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER= cy@FreeBSD.org COMMENT= Network UPS Tools USE_GITHUB= yes GH_ACCOUNT= networkupstools GH_TAGNAME= 82ba1704 NUT_COMMIT_DATE= 2020.10.25 BROKEN_powerpc64= Poudriere builds fail. BROKEN_powerpc= Poudriere builds fail. GNU_CONFIGURE= yes USE_LDCONFIG= yes USES= autoreconf:build gmake libtool pkgconfig python:build NUT_USER?= uucp NUT_GROUP?= uucp STATEDIR?= /var/db/nut PLIST_SUB+= NUT_USER=${NUT_USER} PLIST_SUB+= NUT_GROUP=${NUT_GROUP} OPTIONS_DEFAULT=SERIAL USB SNMP NEON IPMI_OFF SSL_OFF OPTIONS_DEFINE= SERIAL USB SNMP NEON PDU CGI BASH AVAHI DOCS OPTIONS_SINGLE= IPMI SSL OPTIONS_SINGLE_IPMI= IPMI_OFF IPMIPSU FREEIPMI OPTIONS_SINGLE_SSL= SSL_OFF OPENSSL NSS SERIAL_DESC= SERIAL support USB_DESC= USB support SNMP_DESC= SNMP support NEON_DESC= NEON XML/HTTP support PDU_DESC= Powerman PDU support CGI_DESC= Web CGI interface BASH_DESC= Bash Completion support AVAHI_DESC= Avahi support IPMI_OFF_DESC= No IPMI support FREEIPMI_DESC= freeipmi support IPMIPSU_DESC= Use nut-ipmipsu support (experimental) SSL_OFF_DESC= No SSL support USE_RC_SUBR= nut nut_upsmon nut_upslog SUB_LIST+= STATEDIR=${STATEDIR} PLIST_SUB+= STATEDIR=${STATEDIR} PORTDOCS= * .include CONFIGURE_ARGS= --sysconfdir=${PREFIX}/etc/nut \ --program-transform-name="" \ --localstatedir=${STATEDIR} \ --datadir=${PREFIX}/etc/nut \ --with-devd-dir=${PREFIX}/etc/devd \ --with-drvpath=${PREFIX}/libexec/nut \ --with-statepath=${STATEDIR} \ --with-altpidpath=${STATEDIR} \ --with-pidpath=${STATEDIR} \ --with-pkgconfig-dir=${PREFIX}/libdata/pkgconfig \ --with-user=${NUT_USER} \ --with-group=${NUT_GROUP} \ --with-dev BUILD_DEPENDS= asciidoc:textproc/asciidoc .if ${PORT_OPTIONS:MCGI} LIB_DEPENDS+= libgd.so:graphics/gd CGIDIR?= ${PREFIX}/www/cgi-bin/${PORTNAME} CGIDIR_REL?= ${CGIDIR:S,^${PREFIX}/,,} CONFIGURE_ARGS+= --with-cgi --with-cgipath=${CGIDIR} \ --with-htmlpath=${WWWDIR} \ --with-gd-includes=-I${LOCALBASE}/include \ --with-gd-libs="-L${LOCALBASE}/lib -lgd" PLIST_SUB+= NUT_CGI="" PLIST_SUB+= CGIDIR="${CGIDIR_REL}" PLIST_SUB+= CGIETCDIR="etc/nut/" .else CONFIGURE_ARGS+= --without-cgi PLIST_SUB+= NUT_CGI="@comment " .endif .if ${PORT_OPTIONS:MSERIAL} CONFIGURE_ARGS+= --with-serial PLIST_SUB+= NUT_SERIAL="" .else CONFIGURE_ARGS+= --without-serial PLIST_SUB+= NUT_SERIAL="@comment " .endif .if ${PORT_OPTIONS:MUSB} #EXTRA_PATCHES= ${FILESDIR}/extra-patch-m4_nut_check_libusb.m4 CONFIGURE_ARGS+= --with-usb=auto PLIST_SUB+= NUT_USB="" .else CONFIGURE_ARGS+= --without-usb PLIST_SUB+= NUT_USB="@comment " .endif .if ${PORT_OPTIONS:MSNMP} LIB_DEPENDS+= libnetsnmp.so:net-mgmt/net-snmp CONFIGURE_ARGS+= --with-snmp PLIST_SUB+= NUT_SNMP="" .else CONFIGURE_ARGS+= --without-snmp PLIST_SUB+= NUT_SNMP="@comment " .endif .if ${PORT_OPTIONS:MNEON} LIB_DEPENDS+= libneon.so:www/neon CONFIGURE_ARGS+= --with-neon PLIST_SUB+= NUT_NEON="" .else CONFIGURE_ARGS+= --without-neon CONFIGURE_ARGS+= --disable-neon PLIST_SUB+= NUT_NEON="@comment " .endif .if ${PORT_OPTIONS:MPDU} LIB_DEPENDS+= libpowerman.so:sysutils/powerman CONFIGURE_ARGS+= --with-powerman PLIST_SUB+= NUT_PDU="" .else CONFIGURE_ARGS+= --without-powerman PLIST_SUB+= NUT_PDU="@comment " .endif .if ${PORT_OPTIONS:MBASH} BUILD_DEPENDS+= ${LOCALBASE}/share/bash-completion/bash_completion.sh:shells/bash-completion RUN_DEPENDS+= ${LOCALBASE}/share/bash-completion/bash_completion.sh:shells/bash-completion PLIST_SUB+= BASH="" .else PLIST_SUB+= BASH="@comment " .endif .if ${PORT_OPTIONS:MAVAHI} BUILD_DEPENDS+= ${LOCALBASE}/include/avahi-ui/avahi-ui.h:net/avahi-header BUILD_DEPENDS+= avahi-daemon:net/avahi-app RUN_DEPENDS+= avahi-daemon:net/avahi-app CONFIGURE_ARGS+= --with-avahi .else CONFIGURE_ARGS+= --without-avahi .endif .if ${PORT_OPTIONS:MFREEIPMI} LIB_DEPENDS+= libfreeipmi.so:sysutils/freeipmi CONFIGURE_ARGS+= --with-freeipmi PLIST_SUB+= NUT_FREEIPMI="" .else CONFIGURE_ARGS+= --without-freeipmi PLIST_SUB+= NUT_FREEIPMI="@comment " .endif .if ${PORT_OPTIONS:MIPMIPSU} LIB_DEPENDS+= libfreeipmi.so:sysutils/freeipmi CONFIGURE_ARGS+= --with-ipmi PLIST_SUB+= NUT_IPMIPSU="" .else CONFIGURE_ARGS+= --without-ipmi PLIST_SUB+= NUT_IPMIPSU="@comment " .endif .if ${PORT_OPTIONS:MOPENSSL} USES+= ssl CONFIGURE_ARGS+= --with-openssl .elif ${PORT_OPTIONS:MNSS} LIB_DEPENDS= libnss3.so:security/nss CONFIGURE_ARGS+= --with-nss .else CONFIGURE_ARGS+= --without-openssl --without-ssl .endif post-patch: @${REINPLACE_CMD} -i '' -e 's|python|${PYTHON_CMD}|' ${WRKSRC}/autogen.sh @${FIND} ${WRKSRC} -type f | ${XARGS} ${REINPLACE_CMD} -i '' -e 's|/usr/bin/env python|${PYTHON_CMD}|' pre-configure: cd ${WRKSRC} && ./autogen.sh pre-install: @${MKDIR} ${STAGEDIR}${PREFIX}/libexec/nut @${REINPLACE_CMD} -e 's/device-name\*/cdev/g' ${WRKSRC}/scripts/devd/nut-usb.conf post-install: @${MKDIR} ${STAGEDIR}${STATEDIR} @${MKDIR} ${STAGEDIR}${PREFIX}/etc/syslog.d .if ${PORT_OPTIONS:MBASH} @${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d/ ${INSTALL_DATA} ${WRKSRC}/scripts/misc/nut.bash_completion ${STAGEDIR}${PREFIX}/etc/bash_completion.d/ .endif .if ${PORT_OPTIONS:MDOCS} @${MKDIR} ${STAGEDIR}${DOCSDIR}/cables ${INSTALL_DATA} ${WRKSRC}/docs/cables/*.txt ${STAGEDIR}${DOCSDIR}/cables ${INSTALL_DATA} ${WRKSRC}/docs/*.txt ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/docs/FAQ.txt ${STAGEDIR}${DOCSDIR} .for file in AUTHORS COPYING INSTALL MAINTAINERS NEWS README UPGRADING ${INSTALL_DATA} ${WRKSRC}/${file} ${STAGEDIR}${DOCSDIR} .endfor .endif @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${PATCHDIR}/nut.syslog ${STAGEDIR}${EXAMPLESDIR}/syslog.sample ${INSTALL_DATA} ${PATCHDIR}/nut.newsyslog ${STAGEDIR}${EXAMPLESDIR}/newsyslog.sample ${MKDIR} ${STAGEDIR}/var/log/nut .include Index: head/sysutils/nut-devel/files/patch-drivers_blazer__usb.c =================================================================== --- head/sysutils/nut-devel/files/patch-drivers_blazer__usb.c (revision 555090) +++ head/sysutils/nut-devel/files/patch-drivers_blazer__usb.c (nonexistent) @@ -1,79 +0,0 @@ ---- drivers/blazer_usb.c.orig 2015-12-29 12:08:34 UTC -+++ drivers/blazer_usb.c -@@ -118,9 +118,9 @@ static int phoenix_command(const char *cmd, char *buf, - */ - switch (ret) - { -- case -EPIPE: /* Broken pipe */ -+ case LIBUSB_ERROR_PIPE: /* Broken pipe */ - usb_clear_halt(udev, 0x81); -- case -ETIMEDOUT: /* Connection timed out */ -+ case LIBUSB_ERROR_TIMEOUT: /* Connection timed out */ - break; - } - -@@ -188,7 +188,7 @@ static int ippon_command(const char *cmd, char *buf, s - 0x09, 0x2, 0, &tmp[i], 8, 1000); - - if (ret <= 0) { -- upsdebugx(3, "send: %s", (ret != -ETIMEDOUT) ? usb_strerror() : "Connection timed out"); -+ upsdebugx(3, "send: %s", (ret != LIBUSB_ERROR_TIMEOUT) ? usb_strerror() : "Connection timed out"); - return ret; - } - } -@@ -203,7 +203,7 @@ static int ippon_command(const char *cmd, char *buf, s - * will happen after successfully writing a command to the UPS) - */ - if (ret <= 0) { -- upsdebugx(3, "read: %s", (ret != -ETIMEDOUT) ? usb_strerror() : "Connection timed out"); -+ upsdebugx(3, "read: %s", (ret != LIBUSB_ERROR_TIMEOUT) ? usb_strerror() : "Connection timed out"); - return ret; - } - -@@ -423,38 +423,28 @@ int blazer_command(const char *cmd, char *buf, size_t - - switch (ret) - { -- case -EBUSY: /* Device or resource busy */ -+ case LIBUSB_ERROR_BUSY: /* Device or resource busy */ - fatal_with_errno(EXIT_FAILURE, "Got disconnected by another driver"); - -- case -EPERM: /* Operation not permitted */ -- fatal_with_errno(EXIT_FAILURE, "Permissions problem"); -- -- case -EPIPE: /* Broken pipe */ -+ case LIBUSB_ERROR_PIPE: /* Broken pipe */ - if (usb_clear_halt(udev, 0x81) == 0) { - upsdebugx(1, "Stall condition cleared"); - break; - } --#ifdef ETIME -- case -ETIME: /* Timer expired */ --#endif - if (usb_reset(udev) == 0) { - upsdebugx(1, "Device reset handled"); - } -- case -ENODEV: /* No such device */ -- case -EACCES: /* Permission denied */ -- case -EIO: /* I/O error */ -- case -ENXIO: /* No such device or address */ -- case -ENOENT: /* No such file or directory */ -+ case LIBUSB_ERROR_NO_DEVICE: /* No such device */ -+ case LIBUSB_ERROR_ACCESS: /* Permission denied */ -+ case LIBUSB_ERROR_IO: /* I/O error */ -+ case LIBUSB_ERROR_NOT_FOUND: /* No such file or directory */ - /* Uh oh, got to reconnect! */ - usb->close(udev); - udev = NULL; - break; - -- case -ETIMEDOUT: /* Connection timed out */ -- case -EOVERFLOW: /* Value too large for defined data type */ --#ifdef EPROTO -- case -EPROTO: /* Protocol error */ --#endif -+ case LIBUSB_ERROR_TIMEOUT: /* Connection timed out */ -+ case LIBUSB_ERROR_OVERFLOW: /* Value too large for defined data type */ - default: - break; - } Property changes on: head/sysutils/nut-devel/files/patch-drivers_blazer__usb.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/nut-devel/files/patch-drivers_libshut.c =================================================================== --- head/sysutils/nut-devel/files/patch-drivers_libshut.c (revision 555090) +++ head/sysutils/nut-devel/files/patch-drivers_libshut.c (nonexistent) @@ -1,23 +0,0 @@ ---- 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) Property changes on: head/sysutils/nut-devel/files/patch-drivers_libshut.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/nut-devel/files/patch-drivers_tripplite__usb.c =================================================================== --- head/sysutils/nut-devel/files/patch-drivers_tripplite__usb.c (revision 555090) +++ head/sysutils/nut-devel/files/patch-drivers_tripplite__usb.c (nonexistent) @@ -1,20 +0,0 @@ ---- drivers/tripplite_usb.c.orig 2015-12-29 12:08:34 UTC -+++ drivers/tripplite_usb.c -@@ -499,7 +499,7 @@ void usb_comm_fail(int res, const char *msg) - static int try = 0; - - switch(res) { -- case -EBUSY: -+ case LIBUSB_ERROR_BUSY: - upslogx(LOG_WARNING, "%s: Device claimed by another process", msg); - fatalx(EXIT_FAILURE, "Terminating: EBUSY"); - break; -@@ -907,7 +907,7 @@ void upsdrv_initinfo(void) - if(tl_model != TRIPP_LITE_SMARTPRO ) { - ret = send_cmd(w_msg, sizeof(w_msg), w_value, sizeof(w_value)-1); - if(ret <= 0) { -- if(ret == -EPIPE) { -+ if(ret == LIBUSB_ERROR_PIPE) { - fatalx(EXIT_FAILURE, "Could not reset watchdog. Please check and" - "see if usbhid-ups(8) works with this UPS."); - } else { Property changes on: head/sysutils/nut-devel/files/patch-drivers_tripplite__usb.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/nut-devel/files/patch-drivers_riello__usb.c =================================================================== --- head/sysutils/nut-devel/files/patch-drivers_riello__usb.c (revision 555090) +++ head/sysutils/nut-devel/files/patch-drivers_riello__usb.c (nonexistent) @@ -1,53 +0,0 @@ ---- drivers/riello_usb.c.orig 2015-12-29 12:08:34 UTC -+++ drivers/riello_usb.c -@@ -346,42 +346,28 @@ int riello_command(uint8_t *cmd, uint8_t *buf, uint16_ - - switch (ret) - { -- case -EBUSY: /* Device or resource busy */ -+ case LIBUSB_ERROR_BUSY: /* Device or resource busy */ - fatal_with_errno(EXIT_FAILURE, "Got disconnected by another driver"); - -- case -EPERM: /* Operation not permitted */ -- fatal_with_errno(EXIT_FAILURE, "Permissions problem"); -- -- case -EPIPE: /* Broken pipe */ -+ case LIBUSB_ERROR_PIPE: /* Broken pipe */ - if (usb_clear_halt(udev, 0x81) == 0) { - upsdebugx(1, "Stall condition cleared"); - break; - } --#ifdef ETIME -- case -ETIME: /* Timer expired */ --#endif - if (usb_reset(udev) == 0) { - upsdebugx(1, "Device reset handled"); - } -- case -ENODEV: /* No such device */ -- case -EACCES: /* Permission denied */ -- case -EIO: /* I/O error */ -- case -ENXIO: /* No such device or address */ -- case -ENOENT: /* No such file or directory */ -+ case LIBUSB_ERROR_NO_DEVICE: /* No such device */ -+ case LIBUSB_ERROR_ACCESS: /* Permission denied */ -+ case LIBUSB_ERROR_IO: /* I/O error */ -+ case LIBUSB_ERROR_NOT_FOUND: /* No such file or directory */ - /* Uh oh, got to reconnect! */ - usb->close(udev); - udev = NULL; - break; - -- case -ETIMEDOUT: /* Connection timed out */ -- upsdebugx (3, "riello_command err: Resource temporarily unavailable"); -- -- -- case -EOVERFLOW: /* Value too large for defined data type */ --#ifdef EPROTO -- case -EPROTO: /* Protocol error */ --#endif -- break; -+ case LIBUSB_ERROR_TIMEOUT: /* Connection timed out */ -+ case LIBUSB_ERROR_OVERFLOW: /* Value too large for defined data type */ - default: - break; - } Property changes on: head/sysutils/nut-devel/files/patch-drivers_riello__usb.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/nut-devel/files/patch-drivers_libusb.c =================================================================== --- head/sysutils/nut-devel/files/patch-drivers_libusb.c (revision 555090) +++ head/sysutils/nut-devel/files/patch-drivers_libusb.c (nonexistent) @@ -1,65 +0,0 @@ ---- drivers/libusb.c.orig 2015-12-29 12:08:34 UTC -+++ drivers/libusb.c -@@ -428,26 +428,21 @@ static int libusb_strerror(const int ret, const char * - - switch(ret) - { -- case -EBUSY: /* Device or resource busy */ -- case -EPERM: /* Operation not permitted */ -- case -ENODEV: /* No such device */ -- case -EACCES: /* Permission denied */ -- case -EIO: /* I/O error */ -- case -ENXIO: /* No such device or address */ -- case -ENOENT: /* No such file or directory */ -- case -EPIPE: /* Broken pipe */ -- case -ENOSYS: /* Function not implemented */ -+ case LIBUSB_ERROR_BUSY: /* Device or resource busy */ -+ case LIBUSB_ERROR_NO_DEVICE: /* No such device */ -+ case LIBUSB_ERROR_ACCESS: /* Permission denied */ -+ case LIBUSB_ERROR_IO: /* I/O error */ -+ case LIBUSB_ERROR_NOT_FOUND: /* No such file or directory */ -+ case LIBUSB_ERROR_PIPE: /* Broken pipe */ -+ case LIBUSB_ERROR_NOT_SUPPORTED: /* Function not implemented */ - upslogx(LOG_DEBUG, "%s: %s", desc, usb_strerror()); - return ret; - -- case -ETIMEDOUT: /* Connection timed out */ -+ case LIBUSB_ERROR_TIMEOUT: /* Connection timed out */ - upsdebugx(2, "%s: Connection timed out", desc); - return 0; - -- case -EOVERFLOW: /* Value too large for defined data type */ --#ifdef EPROTO -- case -EPROTO: /* Protocol error */ --#endif -+ case LIBUSB_ERROR_OVERFLOW: /* Value too large for defined data type */ - upsdebugx(2, "%s: %s", desc, usb_strerror()); - return 0; - -@@ -478,7 +473,7 @@ static int libusb_get_report(usb_dev_handle *udev, int - 0, raw_buf, ReportSize, USB_TIMEOUT); - - /* Ignore "protocol stall" (for unsupported request) on control endpoint */ -- if (ret == -EPIPE) { -+ if (ret == LIBUSB_ERROR_PIPE) { - return 0; - } - -@@ -500,7 +495,7 @@ static int libusb_set_report(usb_dev_handle *udev, int - 0, raw_buf, ReportSize, USB_TIMEOUT); - - /* Ignore "protocol stall" (for unsupported request) on control endpoint */ -- if (ret == -EPIPE) { -+ if (ret == LIBUSB_ERROR_PIPE) { - return 0; - } - -@@ -532,7 +527,7 @@ static int libusb_get_interrupt(usb_dev_handle *udev, - ret = usb_interrupt_read(udev, 0x81, (char *)buf, bufsize, timeout); - - /* Clear stall condition */ -- if (ret == -EPIPE) { -+ if (ret == LIBUSB_ERROR_PIPE) { - ret = usb_clear_halt(udev, 0x81); - } - Property changes on: head/sysutils/nut-devel/files/patch-drivers_libusb.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/nut-devel/files/patch-drivers_usbhid-ups.c =================================================================== --- head/sysutils/nut-devel/files/patch-drivers_usbhid-ups.c (revision 555090) +++ head/sysutils/nut-devel/files/patch-drivers_usbhid-ups.c (nonexistent) @@ -1,74 +0,0 @@ ---- drivers/usbhid-ups.c.orig 2015-12-29 12:08:34 UTC -+++ drivers/usbhid-ups.c -@@ -30,6 +30,7 @@ - #define DRIVER_VERSION "0.41" - - #include "main.h" -+#include "libusb.h" - #include "libhid.h" - #include "usbhid-ups.h" - #include "hidparser.h" -@@ -790,22 +790,14 @@ void upsdrv_updateinfo(void) - /* Get HID notifications on Interrupt pipe first */ - if (use_interrupt_pipe == TRUE) { - evtCount = HIDGetEvents(udev, event, MAX_EVENT_NUM); -- switch (evtCount) -- { -- case -EBUSY: /* Device or resource busy */ -- upslog_with_errno(LOG_CRIT, "Got disconnected by another driver"); -- case -EPERM: /* Operation not permitted */ -- case -ENODEV: /* No such device */ -- case -EACCES: /* Permission denied */ -- case -EIO: /* I/O error */ -- case -ENXIO: /* No such device or address */ -- case -ENOENT: /* No such file or directory */ -+ if (evtCount < 0) { -+ if (evtCount == LIBUSB_ERROR_BUSY) { -+ upslog_with_errno(LOG_CRIT, "Got disconnected by another driver"); -+ } - /* Uh oh, got to reconnect! */ - hd = NULL; -- return; -- default: -+ } else { - upsdebugx(1, "Got %i HID objects...", (evtCount >= 0) ? evtCount : 0); -- break; - } - } else { - evtCount = 0; -@@ -1280,14 +1272,12 @@ static bool_t hid_ups_walk(walkmode_t mode) - - switch (retcode) - { -- case -EBUSY: /* Device or resource busy */ -+ case LIBUSB_ERROR_BUSY: /* Device or resource busy */ - upslog_with_errno(LOG_CRIT, "Got disconnected by another driver"); -- case -EPERM: /* Operation not permitted */ -- case -ENODEV: /* No such device */ -- case -EACCES: /* Permission denied */ -- case -EIO: /* I/O error */ -- case -ENXIO: /* No such device or address */ -- case -ENOENT: /* No such file or directory */ -+ case LIBUSB_ERROR_NO_DEVICE: /* No such device */ -+ case LIBUSB_ERROR_ACCESS: /* Permission denied */ -+ case LIBUSB_ERROR_IO: /* I/O error */ -+ case LIBUSB_ERROR_NOT_FOUND: /* No such file or directory */ - /* Uh oh, got to reconnect! */ - hd = NULL; - return FALSE; -@@ -1298,12 +1288,9 @@ static bool_t hid_ups_walk(walkmode_t mode) - case 0: - continue; - -- 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 */ -+ case LIBUSB_ERROR_TIMEOUT: /* Connection timed out */ -+ case LIBUSB_ERROR_OVERFLOW: /* Value too large for defined data type */ -+ case LIBUSB_ERROR_PIPE: /* Broken pipe */ - default: - /* Don't know what happened, try again later... */ - continue; Property changes on: head/sysutils/nut-devel/files/patch-drivers_usbhid-ups.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/nut-devel/files/patch-drivers_libusb.h =================================================================== --- head/sysutils/nut-devel/files/patch-drivers_libusb.h (revision 555090) +++ head/sysutils/nut-devel/files/patch-drivers_libusb.h (nonexistent) @@ -1,27 +0,0 @@ ---- drivers/libusb.h.orig 2015-12-29 12:08:34 UTC -+++ drivers/libusb.h -@@ -36,6 +36,24 @@ - - #include /* libusb header file */ - -+/* libusb 1.0 errors used by FreeBSD */ -+enum libusb_error { -+ LIBUSB_SUCCESS = 0, -+ LIBUSB_ERROR_IO = -1, -+ LIBUSB_ERROR_INVALID_PARAM = -2, -+ LIBUSB_ERROR_ACCESS = -3, -+ LIBUSB_ERROR_NO_DEVICE = -4, -+ LIBUSB_ERROR_NOT_FOUND = -5, -+ LIBUSB_ERROR_BUSY = -6, -+ LIBUSB_ERROR_TIMEOUT = -7, -+ LIBUSB_ERROR_OVERFLOW = -8, -+ LIBUSB_ERROR_PIPE = -9, -+ LIBUSB_ERROR_INTERRUPTED = -10, -+ LIBUSB_ERROR_NO_MEM = -11, -+ LIBUSB_ERROR_NOT_SUPPORTED = -12, -+ LIBUSB_ERROR_OTHER = -99, -+}; -+ - extern upsdrv_info_t comm_upsdrv_info; - - /*! Property changes on: head/sysutils/nut-devel/files/patch-drivers_libusb.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/nut-devel/files/patch-drivers_nutdrv__qx.c =================================================================== --- head/sysutils/nut-devel/files/patch-drivers_nutdrv__qx.c (revision 555090) +++ head/sysutils/nut-devel/files/patch-drivers_nutdrv__qx.c (nonexistent) @@ -1,79 +0,0 @@ ---- drivers/nutdrv_qx.c.orig 2016-03-08 12:01:11 UTC -+++ drivers/nutdrv_qx.c -@@ -561,9 +561,9 @@ static int phoenix_command(const char *cmd, char *buf, - * In order to read correct replies we need to flush the output buffers of the converter until we get no more data (ie, it times out). */ - switch (ret) - { -- case -EPIPE: /* Broken pipe */ -+ case LIBUSB_ERROR_PIPE: /* Broken pipe */ - usb_clear_halt(udev, 0x81); -- case -ETIMEDOUT: /* Connection timed out */ -+ case LIBUSB_ERROR_TIMEOUT: /* Connection timed out */ - break; - } - -@@ -635,7 +635,7 @@ static int ippon_command(const char *cmd, char *buf, s - ret = usb_control_msg(udev, USB_ENDPOINT_OUT + USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x09, 0x2, 0, &tmp[i], 8, 1000); - - if (ret <= 0) { -- upsdebugx(3, "send: %s (%d)", (ret != -ETIMEDOUT) ? usb_strerror() : "Connection timed out", ret); -+ upsdebugx(3, "send: %s (%d)", (ret != LIBUSB_ERROR_TIMEOUT) ? usb_strerror() : "Connection timed out", ret); - return ret; - } - -@@ -648,7 +648,7 @@ static int ippon_command(const char *cmd, char *buf, s - - /* Any errors here mean that we are unable to read a reply (which will happen after successfully writing a command to the UPS) */ - if (ret <= 0) { -- upsdebugx(3, "read: %s (%d)", (ret != -ETIMEDOUT) ? usb_strerror() : "Connection timed out", ret); -+ upsdebugx(3, "read: %s (%d)", (ret != LIBUSB_ERROR_TIMEOUT) ? usb_strerror() : "Connection timed out", ret); - return ret; - } - -@@ -2124,38 +2124,28 @@ static int qx_command(const char *cmd, char *buf, size - - switch (ret) - { -- case -EBUSY: /* Device or resource busy */ -+ case LIBUSB_ERROR_BUSY: /* Device or resource busy */ - fatal_with_errno(EXIT_FAILURE, "Got disconnected by another driver"); - -- case -EPERM: /* Operation not permitted */ -- fatal_with_errno(EXIT_FAILURE, "Permissions problem"); -- -- case -EPIPE: /* Broken pipe */ -+ case LIBUSB_ERROR_PIPE: /* Broken pipe */ - if (usb_clear_halt(udev, 0x81) == 0) { - upsdebugx(1, "Stall condition cleared"); - break; - } -- #ifdef ETIME -- case -ETIME: /* Timer expired */ -- #endif /* ETIME */ - if (usb_reset(udev) == 0) { - upsdebugx(1, "Device reset handled"); - } -- case -ENODEV: /* No such device */ -- case -EACCES: /* Permission denied */ -- case -EIO: /* I/O error */ -- case -ENXIO: /* No such device or address */ -- case -ENOENT: /* No such file or directory */ -+ case LIBUSB_ERROR_NO_DEVICE: /* No such device */ -+ case LIBUSB_ERROR_ACCESS: /* Permission denied */ -+ case LIBUSB_ERROR_IO: /* I/O error */ -+ case LIBUSB_ERROR_NOT_FOUND: /* No such file or directory */ - /* Uh oh, got to reconnect! */ - usb->close(udev); - udev = NULL; - break; - -- case -ETIMEDOUT: /* Connection timed out */ -- case -EOVERFLOW: /* Value too large for defined data type */ --#ifdef EPROTO -- case -EPROTO: /* Protocol error */ --#endif -+ case LIBUSB_ERROR_TIMEOUT: /* Connection timed out */ -+ case LIBUSB_ERROR_OVERFLOW: /* Value too large for defined data type */ - default: - break; - } Property changes on: head/sysutils/nut-devel/files/patch-drivers_nutdrv__qx.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/nut-devel/files/patch-drivers_main.h =================================================================== --- head/sysutils/nut-devel/files/patch-drivers_main.h (nonexistent) +++ head/sysutils/nut-devel/files/patch-drivers_main.h (revision 555091) @@ -0,0 +1,10 @@ +--- drivers/main.h.orig 2020-11-13 23:48:39.471828000 -0800 ++++ drivers/main.h 2020-11-13 23:49:42.830476000 -0800 +@@ -1,6 +1,7 @@ + #ifndef MAIN_H + #define MAIN_H + ++#include + #include "common.h" + #include "upsconf.h" + #include "dstate.h" Property changes on: head/sysutils/nut-devel/files/patch-drivers_main.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property