hal: Branch 'hal-0_5_12-branch' - 3 commits

Danny Kukawka dkukawka at kemper.freedesktop.org
Fri May 22 08:21:34 PDT 2009


 configure.in        |    2 +-
 hald/linux/device.c |   13 ++++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

New commits:
commit 02c852b8b8afbce16798c71d91678df1a72785c0
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Wed Mar 18 18:21:52 2009 +0100

    fix sound_compute_udi(): sound.card is int and not a string
    
    Fixed sound_compute_udi(). The type of property sound.card
    is int and not string, use the correct function to get the value.

diff --git a/hald/linux/device.c b/hald/linux/device.c
index 1b3316a..02c456f 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -3496,7 +3496,7 @@ sound_compute_udi (HalDevice *d)
 		hald_compute_udi (udi, sizeof (udi),
 				  "%s_sound_card_%i",
 				  hal_device_property_get_string (d, "info.parent"),
-				  hal_device_property_get_string (d, "sound.card"));
+				  hal_device_property_get_int (d, "sound.card"));
 	} else if (hal_device_has_property(d, "alsa.card")) {
 		/* don't include card number as it may not be persistent across reboots */
 		hald_compute_udi (udi, sizeof (udi),
commit b40e19fd38a7ff5d01edbcd29b44f46582ce32ac
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Wed Mar 18 17:30:53 2009 +0100

    ignore ADD events if there is already a device with same sysfs_path
    
    Ignore ADD events if there is already a device with the same
    syfs_path available in the GDL or TDL. This should prevent
    problems getting duplicated devices from calling 'udevadm trigger'
    (fd.o#18861) or from some other rare cases (see:
    http://lists.freedesktop.org/archives/hal/2009-February/012954.html).
    
    TODO: Check if it make sense to call a refresh for the already
          existing device instead of ignoring the event completely.

diff --git a/hald/linux/device.c b/hald/linux/device.c
index 6653782..1b3316a 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -4829,11 +4829,22 @@ hotplug_event_begin_add_dev (const gchar *subsystem, const gchar *sysfs_path, co
 		handler = dev_handlers[i];
 		if (strcmp (handler->subsystem, subsystem) == 0) {
 			HalDevice *d;
+			HalDevice *check;
 
 			if (strcmp (subsystem, "scsi") == 0)
 				if (missing_scsi_host (sysfs_path, (HotplugEvent *)end_token, HOTPLUG_ACTION_ADD))
 					goto out;
 
+			/* check if there is already a device with this sysfs_path in the system */
+			if ((check = hal_device_store_match_key_value_string (hald_get_gdl (), "linux.sysfs_path", sysfs_path)) != NULL ||
+			    (check = hal_device_store_match_key_value_string (hald_get_tdl (), "linux.sysfs_path", sysfs_path)) != NULL) {
+				HAL_WARNING(("Have already a device with sysfs_path='%s' and udi='%s'. Ignore new add event for now.", 
+					     sysfs_path, hal_device_get_udi(check)));
+				/* maybe we should do a refresh on the found device ??? */
+				hotplug_event_end (end_token);
+				goto out; 
+			}
+
 			/* attempt to add the device */
 			d = handler->add (sysfs_path, device_file, parent_dev, parent_path);
 			if (d == NULL) {
commit 1040c6eee24829ba7a9eafad86fcd3007b21a50d
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Sat Feb 28 15:56:05 2009 +0100

    set default udev_prefix to ${exec_prefix}/lib in configure.in
    
    Set default udev_prefix to ${exec_prefix}/lib in configure.in to
    get by default ${exec_prefix}/lib/udev/rules.d as the actual
    udev package use. Use --with-udev-prefix to change the path if
    needed.

diff --git a/configure.in b/configure.in
index b868050..0f1933d 100644
--- a/configure.in
+++ b/configure.in
@@ -76,7 +76,7 @@ AC_ARG_WITH([socket-dir],
 
 AC_ARG_WITH(udev-prefix,
         AS_HELP_STRING([--with-udev-prefix=DIR], [add prefix to internal udev path names]),
-        [], [with_udev_prefix='${exec_prefix}'])
+        [], [with_udev_prefix='${exec_prefix}/lib'])
 udev_prefix=$with_udev_prefix
 AC_SUBST(udev_prefix)
 


More information about the hal-commit mailing list