From ac7df885d2015794abd8c06570466a368092c320 Mon Sep 17 00:00:00 2001 From: Danny Kukawka Date: Thu, 6 Dec 2007 20:02:56 +0100 Subject: [PATCH] linux: ignore uevents for modules and driver Make HAL ignore uevents for subsystem=={modules,driver}. We don't use them currently (AFAIK) and don't need to run code if we get them. --- hald/linux/osspec.c | 50 +++++++++++++++++++++++++++----------------------- 1 files changed, 27 insertions(+), 23 deletions(-) diff --git a/hald/linux/osspec.c b/hald/linux/osspec.c index fa9dc69..25da9dd 100644 --- a/hald/linux/osspec.c +++ b/hald/linux/osspec.c @@ -229,32 +229,36 @@ hald_udev_data (GIOChannel *source, GIOCondition condition, gpointer user_data) hotplug_event->sysfs.seqnum, action, hotplug_event->sysfs.subsystem, hotplug_event->sysfs.sysfs_path, hotplug_event->sysfs.device_file, hotplug_event->sysfs.net_ifindex)); - if (strcmp (action, "add") == 0) { - hotplug_event->action = HOTPLUG_ACTION_ADD; - hotplug_event_enqueue (hotplug_event); - hotplug_event_process_queue (); - goto out; - } + /* ignore module and driver events, until we really need them */ + if ((strcmp (hotplug_event->sysfs.subsystem, "drivers") != 0) && + (strcmp (hotplug_event->sysfs.subsystem, "module") != 0)) { + if (strcmp (action, "add") == 0) { + hotplug_event->action = HOTPLUG_ACTION_ADD; + hotplug_event_enqueue (hotplug_event); + hotplug_event_process_queue (); + goto out; + } - if (strcmp (action, "change") == 0) { - hotplug_event->action = HOTPLUG_ACTION_CHANGE; - hotplug_event_enqueue (hotplug_event); - hotplug_event_process_queue (); - goto out; - } + if (strcmp (action, "change") == 0) { + hotplug_event->action = HOTPLUG_ACTION_CHANGE; + hotplug_event_enqueue (hotplug_event); + hotplug_event_process_queue (); + goto out; + } - if (strcmp (action, "move") == 0) { - hotplug_event->action = HOTPLUG_ACTION_MOVE; - hotplug_event_enqueue (hotplug_event); - hotplug_event_process_queue (); - goto out; - } + if (strcmp (action, "move") == 0) { + hotplug_event->action = HOTPLUG_ACTION_MOVE; + hotplug_event_enqueue (hotplug_event); + hotplug_event_process_queue (); + goto out; + } - if (strcmp (action, "remove") == 0) { - hotplug_event->action = HOTPLUG_ACTION_REMOVE; - hotplug_event_enqueue (hotplug_event); - hotplug_event_process_queue (); - goto out; + if (strcmp (action, "remove") == 0) { + hotplug_event->action = HOTPLUG_ACTION_REMOVE; + hotplug_event_enqueue (hotplug_event); + hotplug_event_process_queue (); + goto out; + } } invalid: -- 1.5.3.7