hal/hald/linux block_class_device.c, 1.61, 1.62 hald_helper.h, 1.2, 1.3 osspec.c, 1.36, 1.37

David Zeuthen david at freedesktop.org
Thu Aug 26 15:16:19 PDT 2004


Update of /cvs/hal/hal/hald/linux
In directory gabe:/tmp/cvs-serv15305/hald/linux

Modified Files:
	block_class_device.c hald_helper.h osspec.c 
Log Message:
2004-08-27  David Zeuthen  <david at fubar.dk>

	* AUTHORS: Add Kay Sievers <kay.sievers at vrfy.org> cause he rocks.
	Sort the list in alphabetical order of surname (I'm just soo
	political correct :-)

	* fdi/20freedesktop/canon-digital-ixus-v.fdi: Merge onto usb_device
	since we really don't know what interface to target

	* hald/linux/hald_helper.h: Change comment about seqnum

	* hald/linux/libsysfs/sysfs_dir.c (sysfs_open_link): Patch from
	Steve Grubb <linux4_ever at yahoo.com> to fix leak on error condition.

	* hald/linux/osspec.c: 
	(add_computer_callouts_done): Move from TDL to GDL
	(osspec_probe): Add to TDL; callouts may need it (seen by Kristof
	Vansant <de_lupus at pandora.be>
	(hald_helper_device_node): Print out seqnum
	(hald_helper_data): Pass seqnum

	* hald/logger.h: Ignore ENABLE_VERBOSE_MODE; always compile all
	logging statements in (should take the heat of some bugreports)

	* tools/linux/hal_dev.c (main): Pass seqnum if available; otherwise
	pass -1.



Index: block_class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/block_class_device.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- block_class_device.c	25 Aug 2004 23:56:09 -0000	1.61
+++ block_class_device.c	26 Aug 2004 22:16:17 -0000	1.62
@@ -344,6 +344,8 @@
 	close (fd);
 }
 
+
+
 /** Force unmount of a patition. Must have block.volume=1 and valid
  *  block.device
  *

Index: hald_helper.h
===================================================================
RCS file: /cvs/hal/hal/hald/linux/hald_helper.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- hald_helper.h	17 Aug 2004 09:29:24 -0000	1.2
+++ hald_helper.h	26 Aug 2004 22:16:17 -0000	1.3
@@ -35,7 +35,7 @@
 	unsigned int magic;                    /**< magic */
 	int is_hotplug_or_dev;                 /**< 1 if hotplug msg, 0 if device msg */
 	int is_add;                            /**< 1 if add, 0 if remove */
-	int seqnum;                            /**< Sequence number (only for hotplug) */
+	int seqnum;                            /**< Sequence number (may be -1 if for dev if udev has no support) */
 	char subsystem[HALD_HELPER_STRLEN];    /**< subsystem e.g. usb, pci (only for hotplug msg) */
 	char sysfs_path[HALD_HELPER_STRLEN];   /**< path into sysfs without sysfs mountpoint, e.g. /block/sda */
 	char device_node[HALD_HELPER_STRLEN];  /**< fully qualified path of device node (only for device msg) */

Index: osspec.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/osspec.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- osspec.c	26 Aug 2004 18:04:20 -0000	1.36
+++ osspec.c	26 Aug 2004 22:16:17 -0000	1.37
@@ -116,7 +116,7 @@
 static void hotplug_sem_up (void);
 static void hotplug_sem_down (void);
 static void hald_helper_hotplug (gboolean is_add, int seqnum, char *subsystem, char *sysfs_path);
-static void hald_helper_device_node (gboolean is_add, char *subsystem, char *sysfs_path, char *device_node);
+static void hald_helper_device_node (gboolean is_add, int seqnum, char *subsystem, char *sysfs_path, char *device_node);
 static gboolean hald_helper_data (GIOChannel *source, GIOCondition condition, gpointer user_data);
 
 static HalDevice *add_device (const char *sysfs_path, const char *subsystem);
@@ -771,6 +771,8 @@
 {
 	GSList *coldplug_list = user_data;
 
+	g_object_ref (device);
+	hal_device_store_remove (hald_get_tdl (), device);
 	hal_device_store_add (hald_get_gdl (), device);
 	g_signal_handlers_disconnect_by_func (device,
 					      add_computer_callouts_done,
@@ -814,6 +816,7 @@
 		hal_device_property_set_string (root, "kernel.machine",
 						un.machine);
 	}
+	hal_device_store_add (hald_get_tdl (), root);
 
 	/* begin processing the coldplug_list when computer is added */
 	g_signal_connect (root,
@@ -1149,14 +1152,14 @@
 }
 
 static void
-hald_helper_device_node (gboolean is_add, gchar *subsystem, gchar *sysfs_path, gchar *device_node)
+hald_helper_device_node (gboolean is_add, int seqnum, gchar *subsystem, gchar *sysfs_path, gchar *device_node)
 {
 	char sysfs_path_full[SYSFS_PATH_MAX];
 
 	snprintf (sysfs_path_full, SYSFS_PATH_MAX, "%s%s", sysfs_mount_path, sysfs_path);
 
-	HAL_INFO (("entering %s, subsystem=%s devpath=%s devnode=%s",
-		   (is_add ? "add" : "rem"), subsystem, sysfs_path, device_node));
+	HAL_INFO (("entering %s, Seqnum=%d  subsystem=%s devpath=%s devnode=%s",
+		   (is_add ? "add" : "rem"), seqnum, subsystem, sysfs_path, device_node));
 
 	if (is_add ) {
 
@@ -1325,7 +1328,7 @@
 
 	if (!msg.is_hotplug_or_dev) {
 		/* device events doesn't have seqnum on them, however udev also respect sequence numbers */
-		hald_helper_device_node (msg.is_add, g_strdup (msg.subsystem), g_strdup (msg.sysfs_path), 
+		hald_helper_device_node (msg.is_add, msg.seqnum, g_strdup (msg.subsystem), g_strdup (msg.sysfs_path), 
 					 g_strdup (msg.device_node));
 		goto out;
 	}




More information about the hal-commit mailing list