1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-26 00:55:14 +00:00

Properly close the USB devices we open for probing.

This commit is contained in:
Joe Marcus Clarke 2012-04-16 06:46:07 +00:00
parent fda9f74f4f
commit 99e1f3cd15
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=294897
3 changed files with 37 additions and 9 deletions

View File

@ -8,7 +8,7 @@
PORTNAME= hal
DISTVERSION= 0.5.14
PORTREVISION= 18
PORTREVISION= 19
CATEGORIES= sysutils
MASTER_SITES= http://hal.freedesktop.org/releases/

View File

@ -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,
libhal_device_set_property_string(hfp_ctx, hfp_udi,

View File

@ -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);
}