aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authormarcus <marcus@FreeBSD.org>2012-04-16 14:46:07 +0800
committermarcus <marcus@FreeBSD.org>2012-04-16 14:46:07 +0800
commit31239a8f6434709d42948d5971f9bbca4b827c4b (patch)
tree3151d2516b7923ff949caecb259e0c80f0bc2b70 /sysutils
parentb4892d4c6fb0fe4631f2eab9048bd43ba5fc16b4 (diff)
downloadfreebsd-ports-gnome-31239a8f6434709d42948d5971f9bbca4b827c4b.tar.gz
freebsd-ports-gnome-31239a8f6434709d42948d5971f9bbca4b827c4b.tar.zst
freebsd-ports-gnome-31239a8f6434709d42948d5971f9bbca4b827c4b.zip
Properly close the USB devices we open for probing.
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/hal/Makefile2
-rw-r--r--sysutils/hal/files/patch-hald_freebsd_probe-usb2-device.c20
-rw-r--r--sysutils/hal/files/patch-hald_freebsd_probing_probe-usb2-interface.c24
3 files changed, 37 insertions, 9 deletions
diff --git a/sysutils/hal/Makefile b/sysutils/hal/Makefile
index 346b795a62dc..8e34769cbdb0 100644
--- a/sysutils/hal/Makefile
+++ b/sysutils/hal/Makefile
@@ -8,7 +8,7 @@
PORTNAME= hal
DISTVERSION= 0.5.14
-PORTREVISION= 18
+PORTREVISION= 19
CATEGORIES= sysutils
MASTER_SITES= http://hal.freedesktop.org/releases/
diff --git a/sysutils/hal/files/patch-hald_freebsd_probe-usb2-device.c b/sysutils/hal/files/patch-hald_freebsd_probe-usb2-device.c
index 41ed8936a07e..9e1dbe13485d 100644
--- a/sysutils/hal/files/patch-hald_freebsd_probe-usb2-device.c
+++ b/sysutils/hal/files/patch-hald_freebsd_probe-usb2-device.c
@@ -1,6 +1,14 @@
---- hald/freebsd/probing/probe-usb2-device.c.orig 2009-08-24 05:42:29.000000000 -0700
-+++ hald/freebsd/probing/probe-usb2-device.c 2011-12-30 17:20:52.000000000 -0800
-@@ -148,15 +148,16 @@
+--- hald/freebsd/probing/probe-usb2-device.c.orig 2009-08-24 08:42:29.000000000 -0400
++++ hald/freebsd/probing/probe-usb2-device.c 2012-03-31 15:20:14.000000000 -0400
+@@ -100,6 +100,7 @@ main(int argc, char **argv)
+ if (pcfg == NULL || libusb20_dev_get_info(pdev, &di))
+ {
+ free(pcfg);
++ libusb20_dev_close(pdev);
+ continue;
+ }
+
+@@ -148,15 +149,16 @@ main(int argc, char **argv)
bcdspeed = 0x01200;
break;
case LIBUSB20_SPEED_HIGH:
@@ -20,7 +28,7 @@
}
libhal_device_set_property_double(hfp_ctx, hfp_udi, "usb_device.speed",
-@@ -169,6 +170,9 @@
+@@ -169,6 +171,9 @@ main(int argc, char **argv)
case UD_USB_2_0:
version = 2.0;
break;
@@ -30,7 +38,7 @@
case UD_USB_3_0:
version = 3.0;
break;
-@@ -184,7 +188,7 @@
+@@ -184,7 +189,7 @@ main(int argc, char **argv)
libhal_device_set_property_int(hfp_ctx, hfp_udi,
"usb_device.vendor_id", di.udi_vendorNo, &hfp_error);
libhal_device_set_property_int(hfp_ctx, hfp_udi,
@@ -38,4 +46,4 @@
+ "usb_device.device_revision_bcd", ddesc->bcdDevice, &hfp_error);
libhal_device_set_property_string(hfp_ctx, hfp_udi,
"usb_device.serial", di.udi_serial, &hfp_error);
- libhal_device_set_property_string(hfp_ctx, hfp_udi, \ No newline at end of file
+ libhal_device_set_property_string(hfp_ctx, hfp_udi,
diff --git a/sysutils/hal/files/patch-hald_freebsd_probing_probe-usb2-interface.c b/sysutils/hal/files/patch-hald_freebsd_probing_probe-usb2-interface.c
index fa04e0fa096d..87d13b4d7f3e 100644
--- a/sysutils/hal/files/patch-hald_freebsd_probing_probe-usb2-interface.c
+++ b/sysutils/hal/files/patch-hald_freebsd_probing_probe-usb2-interface.c
@@ -1,5 +1,5 @@
---- hald/freebsd/probing/probe-usb2-interface.c.orig 2010-01-23 22:01:20.000000000 -0500
-+++ hald/freebsd/probing/probe-usb2-interface.c 2010-01-23 22:01:49.000000000 -0500
+--- hald/freebsd/probing/probe-usb2-interface.c.orig 2009-08-24 08:42:29.000000000 -0400
++++ hald/freebsd/probing/probe-usb2-interface.c 2012-04-01 19:36:25.000000000 -0400
@@ -58,11 +58,11 @@ main(int argc, char **argv)
if (pbe == NULL)
goto end;
@@ -14,3 +14,23 @@
if (! addrstr)
goto end;
+@@ -93,7 +93,10 @@ main(int argc, char **argv)
+ curr_config = libusb20_dev_get_config_index(pdev);
+ pcfg = libusb20_dev_alloc_config(pdev, curr_config);
+ if (! pcfg)
+- continue;
++ {
++ libusb20_dev_close(pdev);
++ continue;
++ }
+
+ pif = pcfg->interface + iface;
+
+@@ -129,6 +132,7 @@ main(int argc, char **argv)
+ }
+ }
+
++ libusb20_dev_close(pdev);
+ free(pcfg);
+ }
+