hal/hald/linux block_class_device.c,1.24,1.25

David Zeuthen david at pdx.freedesktop.org
Thu May 27 12:13:41 PDT 2004


Update of /cvs/hal/hal/hald/linux
In directory pdx:/tmp/cvs-serv27742/hald/linux

Modified Files:
	block_class_device.c 
Log Message:
2004-05-27  David Zeuthen  <david at fubar.dk>

	* hald/linux/volume_id/volume_id.c (volume_id_open_node): While
	debugging the file descriptor leak that stops cdroms being
	ejected, I noticed a theoretical file descriptor when the box runs
	out of memory. Patch from Crispin Flowerday <gnome at flowerday.cx>

	* hald/linux/block_class_device.c (block_class_accept): Added this
	since 2nd level block devices, e.g. sda1, doesn't have sysdevices
	and the generic class_device_accept was changed to required this.



Index: block_class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/block_class_device.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- a/block_class_device.c	25 May 2004 20:09:29 -0000	1.24
+++ b/block_class_device.c	27 May 2004 19:13:39 -0000	1.25
@@ -71,6 +71,24 @@
 
 static void detect_fs (HalDevice *d);
 
+static dbus_bool_t
+block_class_accept (ClassDeviceHandler *self,
+		    const char *path,
+		    struct sysfs_class_device *class_device)
+{
+
+	/*HAL_INFO (("path = %s, classname = %s", 
+	  path, self->sysfs_class_name));*/
+
+	/* only care about given sysfs class name */
+	if (strcmp (class_device->classname, self->sysfs_class_name) == 0) {
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+
 static void
 block_class_visit (ClassDeviceHandler *self,
 		   const char *path,
@@ -133,6 +151,8 @@
 		parent_sysfs_path,
 		class_device_got_parent_device, cad,
 		HAL_LINUX_HOTPLUG_TIMEOUT);
+
+	hal_device_print (d);
 }
 
 
@@ -1520,7 +1540,7 @@
 	class_device_init,                  /**< init function */
 	class_device_shutdown,              /**< shutdown function */
 	block_class_tick,                   /**< timer function */
-	class_device_accept,                /**< accept function */
+	block_class_accept,                 /**< accept function */
 	block_class_visit,                  /**< visitor function */
 	block_class_removed,                /**< class device is removed */
 	class_device_udev_event,            /**< handle udev event */





More information about the hal-commit mailing list