hal/hald device.c,1.7,1.8 device.h,1.6,1.7 hald.c,1.14,1.15
David Zeuthen
david at freedesktop.org
Wed Aug 25 13:55:15 PDT 2004
Update of /cvs/hal/hal/hald
In directory gabe:/tmp/cvs-serv31962/hald
Modified Files:
device.c device.h hald.c
Log Message:
2004-08-25 David Zeuthen <david at fubar.dk>
* configure.in: Add option for new callout hal-hotplug-map
* hald/device.[ch]: Add the "cancelled" signal and hal_device_cancel
method
* hald/hald.c (main): Avoid daemonization for now; will make hald
hang if anything fails up-until device probing (RH bug 130849)
* hald/linux/class_device.c (class_device_got_device_file):
Cancel the device if don't get the device file
* hald/linux/common.h: Increase timeout to 60 secs. Make note
about we really need the SEQNUM support in udev
* hald/linux/osspec.c:
(process_coldplug_list_device_cancelled): 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
* tools/Makefile.am: Also remove callout on uninstall
* tools/fstab-sync.c:
(fs_table_remove_volume): 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)
* tools/linux/Makefile.am: Build and, optionally, install
hal-hotplug-map callout
* tools/linux/hal_hotplug_map.c: 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.
Index: device.c
===================================================================
RCS file: /cvs/hal/hal/hald/device.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- device.c 20 Jun 2004 13:27:45 -0000 1.7
+++ device.c 25 Aug 2004 20:55:13 -0000 1.8
@@ -44,6 +44,7 @@
PROPERTY_CHANGED,
CAPABILITY_ADDED,
CALLOUTS_FINISHED,
+ CANCELLED,
LAST_SIGNAL
};
@@ -104,6 +105,16 @@
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 @@
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);
+}
+
Index: device.h
===================================================================
RCS file: /cvs/hal/hal/hald/device.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- device.h 20 Jun 2004 13:27:45 -0000 1.6
+++ device.h 25 Aug 2004 20:55:13 -0000 1.7
@@ -56,6 +56,8 @@
const char *capability);
void (*callouts_finished) (HalDevice *device);
+
+ void (*cancelled) (HalDevice *device);
};
#define HAL_TYPE_DEVICE (hal_device_get_type ())
@@ -150,6 +152,8 @@
void hal_device_callouts_finished (HalDevice *device);
+void hal_device_cancel (HalDevice *device);
+
gboolean hal_device_property_set_attribute (HalDevice *device,
const char *key,
enum PropertyAttribute attr,
Index: hald.c
===================================================================
RCS file: /cvs/hal/hal/hald/hald.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- hald.c 23 Aug 2004 17:59:50 -0000 1.14
+++ hald.c 25 Aug 2004 20:55:13 -0000 1.15
@@ -358,7 +358,7 @@
{
char buf[1];
/* parent, block until child writes */
- read (startup_daemonize_pipe[0], &buf, sizeof (buf));
+ /*read (startup_daemonize_pipe[0], &buf, sizeof (buf));*/
exit (0);
break;
}
More information about the hal-commit
mailing list