hal/hald/linux osspec.c,1.44,1.45

David Zeuthen david at freedesktop.org
Wed Oct 6 13:23:46 PDT 2004


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

Modified Files:
	osspec.c 
Log Message:
2004-10-06  David Zeuthen  <david at fubar.dk>

	* hald/linux/osspec.c (hald_helper_data): New handling of hotplug
	events with SEQNUM < LAST_SEQNUM. Idea from Sjoerd Simons 
	<sjoerd at luon.net>.

2004-10-06  David Zeuthen  <david at fubar.dk>

	Patch from Martin Pitt <martin.pitt at canonical.com>.

	* hald/linux/osspec.c (add_device): Check whether given_sysfs_path
	is NULL and immediately return in this case; previously, this
	parameter was copied and compared without checking, which caused a
	segfault.

	* hald/hald.c (drop_privileges): Do not exit hald if capabilities
	cannot be installed (which happens on kernels which do not support
	capabilities), since only few features actually depend on
	additional capabilities (currently only the "link" detection of
	MII ethernet cards)



Index: osspec.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/osspec.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- osspec.c	20 Sep 2004 18:31:15 -0000	1.44
+++ osspec.c	6 Oct 2004 20:23:44 -0000	1.45
@@ -898,6 +898,11 @@
 	char sysfs_path[SYSFS_PATH_MAX];
 	HalDevice *hal_device = NULL;
 
+	if (given_sysfs_path == NULL) {
+		HAL_WARNING (("given_sysfs_path is NULL, cannot add this device" ));
+		return NULL;
+	}
+
 	strncpy (sysfs_path, given_sysfs_path, SYSFS_PATH_MAX);
 
 	len1 = snprintf (buf1, SYSFS_PATH_MAX, "%s/block", sysfs_mount_path);
@@ -1494,16 +1499,9 @@
 		}
 
 		if (msg.seqnum < last_hotplug_seqnum) {
-			/* yikes, this means were started during a hotplug */
-			HAL_WARNING (("Got SEQNUM=%llu, but last_hotplug_seqnum=%llu", msg.seqnum, last_hotplug_seqnum));
 
-			/* have to process immediately other we may deadlock due to
-			 * the hotplug semaphore */
-			hald_helper_hotplug (msg.action, msg.seqnum, g_strdup (msg.subsystem), 
-					     g_strdup (msg.sysfs_path), &msg);
-			/* still need to process the queue though */
-			hald_helper_hotplug_process_queue ();
-			goto out;
+			/* Just reduce the last_hotplug_seqnum counter */
+			last_hotplug_seqnum = msg.seqnum;
 		}
 
 		/* Queue up this hotplug event and process the queue */




More information about the hal-commit mailing list