Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 May 2009 10:36:50 +0200
From:      Hans Petter Selasky <hselasky@freebsd.org>
To:        gnome@FreeBSD.org, ports@freebsd.org, freebsd-usb@freebsd.org, freebsd-current@freebsd.org
Subject:   Minor USB related sysutils/hal patch
Message-ID:  <200905181036.51184.hselasky@freebsd.org>

next in thread | raw e-mail | index | archive | help
--Boundary-00=_j4REKGJO9Qvs4M9
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,

I've made some minor patches for sysutils/hal

If the device is detached during config read, the config can be NULL. Check 
that.

Make sure that we close the device handles as we go, to save number of open 
files. When the backend is freed any leftover file handles will get freed, so 
it is not absolutely needed to close the device handle in every case.

--HPS

--Boundary-00=_j4REKGJO9Qvs4M9
Content-Type: text/x-diff;
  charset="us-ascii";
  name="files.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
	filename="files.diff"

diff -u -r files.org/patch-configure files/patch-configure
--- files.org/patch-configure	2009-05-18 09:35:47.000000000 +0200
+++ files/patch-configure	2009-05-18 10:23:05.000000000 +0200
@@ -286,7 +286,7 @@
 +main ()
 +{
 +return libusb20_dev_get_info ();
-+  ;
++ 
 +  return 0;
 +}
 +_ACEOF
@@ -325,8 +325,8 @@
 +if test $ac_cv_lib_usb_libusb20_dev_get_info = yes; then
 +  USE_LIBUSB=yes
 +else
-+  USE_LIBUSB=np
++  USE_LIBUSB=no
 +fi
 +
 +fi
diff -u -r files.org/patch-hald_freebsd_probing_probe-usb2-device.c files/patch-hald_freebsd_probing_probe-usb2-device.c
--- files.org/patch-hald_freebsd_probing_probe-usb2-device.c	2009-05-18 09:35:47.000000000 +0200
+++ files/patch-hald_freebsd_probing_probe-usb2-device.c	2009-05-18 09:45:27.000000000 +0200
@@ -96,9 +96,9 @@
 +      pcfg = libusb20_dev_alloc_config(pdev, curr_config);
 +      cdesc = &(pcfg->desc);
 +
-+      if (libusb20_dev_get_info(pdev, &di))
-+        {
-+          free(pcfg);
++      if ((pcfg == NULL) || libusb20_dev_get_info(pdev, &di))
++	{
++	  if (pcfg != NULL) free(pcfg);
 +	  continue;
 +	}
 +
@@ -196,7 +196,7 @@
 +      libhal_device_set_property_string(hfp_ctx, hfp_udi,
 +        "info.vendor", di.udi_vendor, &hfp_error);
 +
-+      free(pcfg);
++      libusb20_dev_close(pdev); free(pcfg);
 +    }
 +end:
 +  if (pbe)

--Boundary-00=_j4REKGJO9Qvs4M9--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905181036.51184.hselasky>