summaryrefslogtreecommitdiff
path: root/hald/device.c
diff options
context:
space:
mode:
authorDavid Zeuthen <david@fubar.dk>2004-08-25 20:55:13 +0000
committerDavid Zeuthen <david@fubar.dk>2004-08-25 20:55:13 +0000
commit68ce0429064b8f2201dba8fc369fac2bc63e89d3 (patch)
tree1bd5ed33bff3782feb1ea9271093ea7158167b02 /hald/device.c
parent8867f98b98c9355d2c80359960e8176c07baf730 (diff)
Add option for new callout hal-hotplug-map
Add the "cancelled" signal and hal_device_cancel method Avoid daemonization for now; will make hald hang if anything fails up-until device probing (RH bug 130849) Cancel the device if don't get the device file Increase timeout to 60 secs. Make note about we really need the SEQNUM support in udev New function (process_coldplug_list): Add support for cancelling (reenable_hotplug_proc_on_device_cancel): New function (hald_helper_hotplug): Add support for cancelling (hotplug_sem_up): Add some helpful debug (hotplug_sem_down): Add some helpful debug (hald_helper_data): Add some helpful debug Also remove callout on uninstall Only require device_file not complete Volume object (remove_udi): Don't require storage device to be present (fixes some problems when unplugging unpartitioned media as we don't get hotplug event and things are thus not serialised) Build and, optionally, install hal-hotplug-map callout New program; a tad Red Hat specific wrt. file locations; patches are welcome. The single purpose of this callout is to detect gphoto2 supported cameras and libsane supported scanners using usermap files in /etc/hotplug.
Diffstat (limited to 'hald/device.c')
-rw-r--r--hald/device.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/hald/device.c b/hald/device.c
index 8558c7a0..e28d89b1 100644
--- a/hald/device.c
+++ b/hald/device.c
@@ -44,6 +44,7 @@ enum {
PROPERTY_CHANGED,
CAPABILITY_ADDED,
CALLOUTS_FINISHED,
+ CANCELLED,
LAST_SIGNAL
};
@@ -104,6 +105,16 @@ hal_device_class_init (HalDeviceClass *klass)
NULL, NULL,
hald_marshal_VOID__VOID,
G_TYPE_NONE, 0);
+
+ signals[CANCELLED] =
+ g_signal_new ("cancelled",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (HalDeviceClass,
+ cancelled),
+ NULL, NULL,
+ hald_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
}
static void
@@ -939,3 +950,12 @@ hal_device_callouts_finished (HalDevice *device)
g_signal_emit (device, signals[CALLOUTS_FINISHED], 0);
}
+/** Used when giving up on a device, e.g. if no device file appeared
+ */
+void
+hal_device_cancel (HalDevice *device)
+{
+ HAL_INFO (("udi=%s", device->udi));
+ g_signal_emit (device, signals[CANCELLED], 0);
+}
+