hal/tools/linux hal_hotplug.c,1.14,1.15
David Zeuthen
david at freedesktop.org
Thu Jul 22 12:06:06 PDT 2004
Update of /cvs/hal/hal/tools/linux
In directory pdx:/tmp/cvs-serv30212a/tools/linux
Modified Files:
hal_hotplug.c
Log Message:
2004-07-22 David Zeuthen <david at fubar.dk>
* tools/linux/hal_hotplug.c (main): Apply the same hack we did to
hal_dev.c some time ago; improves hotplugging speed; suggestion by
Sjoerd Simons.
* hald/linux/block_class_device.c (block_class_visit): Fixed a nasty
bug where .udev.sysfs_path were set before other key properties. This
resulted in lack of information in handle_udev_node_created_found_device
that was invoked as soon as .udev.sysfs_path were set. Obviously
this situation was only applicable when we got the DeviceEvent before
the HotplugEvent. udev is indeed fast.
* hald/linux/class_device.c (class_device_visit): -do-
Index: hal_hotplug.c
===================================================================
RCS file: /cvs/hal/hal/tools/linux/hal_hotplug.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- hal_hotplug.c 4 Jul 2004 20:36:12 -0000 1.14
+++ hal_hotplug.c 22 Jul 2004 19:06:02 -0000 1.15
@@ -272,6 +272,7 @@
DBusMessage *message;
DBusMessageIter iter;
DBusMessageIter iter_dict;
+ int rc;
if (argc != 2)
return 1;
@@ -279,6 +280,20 @@
if (get_sysfs_mnt_path () != 0)
return 1;
+ /* fork a new process so we exit instantly and child is handling
+ * the processing;
+ *
+ * TODO, FIXME, HACK, XXX : This is not the right way; we merely
+ * work around the problem that D-BUS requires us to take a nap
+ * before exiting because otherwise messages are lost
+ */
+ rc = fork ();
+ if (rc == -1)
+ return 1;
+ if (rc != 0)
+ return 0;
+
+
openlog ("hal.hotplug", LOG_PID, LOG_USER);
/* Connect to a well-known bus instance, the system bus */
More information about the hal-commit
mailing list