hal: Branch 'master'
Kay Sievers
kay at kemper.freedesktop.org
Thu Aug 30 18:17:39 PDT 2007
hald/linux/hotplug.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
New commits:
diff-tree f3e160d0ab85f62b76400cb521b4d1b5813d0711 (from a871c7d40e13eb247bce34aae7a9ceafaf719b10)
Author: Kay Sievers <kay.sievers at vrfy.org>
Date: Fri Aug 31 03:20:57 2007 +0200
hotplug: handle "change" events for unknown devices as "add"
If we see a "change" event for a device we do not already know, we use
the event to add the device. For already known devices, we call refresh().
diff --git a/hald/linux/hotplug.c b/hald/linux/hotplug.c
index eb73f7e..38e416c 100644
--- a/hald/linux/hotplug.c
+++ b/hald/linux/hotplug.c
@@ -153,7 +153,8 @@ hotplug_event_begin_sysfs (HotplugEvent
}
if (hotplug_event->type == HOTPLUG_EVENT_SYSFS_DEVICE) {
- if (hotplug_event->action == HOTPLUG_ACTION_ADD) {
+ if (hotplug_event->action == HOTPLUG_ACTION_ADD ||
+ (d == NULL && hotplug_event->action == HOTPLUG_ACTION_CHANGE)) {
HalDevice *parent;
gchar *parent_path;
@@ -175,9 +176,12 @@ hotplug_event_begin_sysfs (HotplugEvent
hotplug_event->sysfs.sysfs_path,
d,
(void *) hotplug_event);
+ } else {
+ hotplug_event_end ((void *) hotplug_event);
}
} else if (hotplug_event->type == HOTPLUG_EVENT_SYSFS_BLOCK) {
- if (hotplug_event->action == HOTPLUG_ACTION_ADD) {
+ if (hotplug_event->action == HOTPLUG_ACTION_ADD ||
+ (d == NULL && hotplug_event->action == HOTPLUG_ACTION_CHANGE)) {
HalDevice *parent;
int range;
gboolean is_partition;
@@ -210,6 +214,8 @@ hotplug_event_begin_sysfs (HotplugEvent
hotplug_event_refresh_blockdev (hotplug_event->sysfs.sysfs_path,
d,
(void *) hotplug_event);
+ } else {
+ hotplug_event_end ((void *) hotplug_event);
}
} else {
/* just ignore this hotplug event */
More information about the hal-commit
mailing list