ports/126922: devel/libusb : update for Network UPS Tools

[ Available lists | Index of freebsd-ports-bugs | Month of Aug 2008 | Week of 28 Aug 2008 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Rene Ladan <r.c.ladan@gmail.com>
Date
28 Aug 2008 19:00:02
Subject
ports/126922: devel/libusb : update for Network UPS Tools
Message-ID
200808281851.m7SIphFD062150@www.freebsd.org


[ Hide this part ]
 
>Number: 126922
>Category: ports
>Synopsis: devel/libusb : update for Network UPS Tools
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Thu Aug 28 19:00:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: Rene Ladan
>Release: 7.0R amd64
>Organization:
>Environment:
FreeBSD self.rene-ladan.nl 7.0-RELEASE-p3 FreeBSD 7.0-RELEASE-p3 #0: Sun Jul 27 17:31:07 CEST 2008 root@self.rene-ladan.nl:/usr/obj/usr/src/sys/RENE amd64
>Description:
>From an user:

I had to modify the bsd.c patch to get NUT (Network UPS tools) working correctly when I attach an UPS via USB to my FreeBSD machine. Without the patch the communication breaks every few seconds because of an full read buffer. NUT checks the input buffer too fast, so the kernel or something else blocks which will cause an communication break to the UPS.


>How-To-Repeat:

>Fix:
apply patch, tested with audio/ifp-line and an iRiver IFP-790

Patch attached with submission follows:

diff -ruN libusb/Makefile /usr/ports/devel/libusb/Makefile
--- libusb/Makefile 2008-04-14 14:25:21.000000000 +0200
+++ /usr/ports/devel/libusb/Makefile 2008-08-28 20:25:33.000000000 +0200
@@ -7,7 +7,7 @@

PORTNAME= libusb
PORTVERSION= 0.1.12
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
diff -ruN libusb/files/patch-bsd.c /usr/ports/devel/libusb/files/patch-bsd.c
--- libusb/files/patch-bsd.c 2006-07-30 13:48:24.000000000 +0200
+++ /usr/ports/devel/libusb/files/patch-bsd.c 2008-08-28 20:19:22.000000000 +0200
@@ -1,5 +1,14 @@
--- bsd.c.orig Sun Jul 30 11:18:07 2006
+++ bsd.c Sun Jul 30 11:20:30 2006
+@@ -408,7 +408,7 @@
+ /* Ensure the endpoint address is correct */
+ ep |= USB_ENDPOINT_IN;
+
+- fd = ensure_ep_open(dev, ep, O_RDONLY);
++ fd = ensure_ep_open(dev, ep, O_RDONLY | O_NONBLOCK);
+ if (fd < 0) {
+ if (usb_debug >= 2) {
+ #ifdef __FreeBSD_kernel__
@@ -623,9 +623,21 @@

int usb_clear_halt(usb_dev_handle *dev, unsigned int ep)


>Release-Note:
>Audit-Trail:
>Unformatted:

Elapsed time: 0.128 seconds