SOURCES: hal-stat-devicefile-not-mountpoint.patch (NEW), hal-dont-...

aflinta aflinta at pld-linux.org
Sun Mar 4 20:50:44 CET 2007


Author: aflinta                      Date: Sun Mar  4 19:50:44 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- patches from fedora/included in GIT

---- Files affected:
SOURCES:
   hal-stat-devicefile-not-mountpoint.patch (NONE -> 1.1)  (NEW), hal-dont-crash-on-cdrom-drives.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/hal-stat-devicefile-not-mountpoint.patch
diff -u /dev/null SOURCES/hal-stat-devicefile-not-mountpoint.patch:1.1
--- /dev/null	Sun Mar  4 20:50:44 2007
+++ SOURCES/hal-stat-devicefile-not-mountpoint.patch	Sun Mar  4 20:50:39 2007
@@ -0,0 +1,83 @@
+diff -urN hal-0.5.8.1.orig/hald/linux/blockdev.c hal-0.5.8.1/hald/linux/blockdev.c
+--- hal-0.5.8.1.orig/hald/linux/blockdev.c	2007-03-04 18:57:02.977766053 +0100
++++ hal-0.5.8.1/hald/linux/blockdev.c	2007-03-04 19:06:43.197888845 +0100
+@@ -168,7 +168,6 @@
+ 	dev_t devt = makedev(0, 0);
+ 	GSList *volumes = NULL;
+ 	GSList *volume;
+-        GSList *autofs_mounts = NULL;
+ 
+ 	/* open /proc/mounts */
+ 	g_snprintf (buf, sizeof (buf), "%s/mounts", get_hal_proc_path ());
+@@ -189,6 +188,8 @@
+ 	while ((mnte = getmntent_r (f, &mnt, buf, sizeof(buf))) != NULL) {
+ 		struct stat statbuf;
+ 
++		/*HAL_INFO ((" * /proc/mounts contain dev %s - type %s", mnt.mnt_fsname, mnt.mnt_type));*/
++
+ 		/* If this is a nfs mount (fstype == 'nfs') ignore the mount. Reason:
+ 		 *  1. we don't list nfs devices in HAL
+ 		 *  2. more problematic: stat on mountpoints with 'stale nfs handle' never come
+@@ -197,35 +198,14 @@
+ 		if (strcmp(mnt.mnt_type, "nfs") == 0)
+ 			continue;
+ 
+-		/* If this is an autofs mount (fstype == 'autofs') 
+-		 * store the mount in a list for later use. 
+-		 * On mounts managed by autofs accessing files below the mount
+-		 * point cause the mount point to be remounted after an 
+-		 * unmount.  We keep the list so we do not check for
+-		 * the .created-by-hal file on mounts under autofs mount points
+-		 */
+-		if (strcmp(mnt.mnt_type, "autofs") == 0) {
+-			char *mnt_dir;
+-
+-			if (mnt.mnt_dir[strlen (mnt.mnt_dir) - 1] != '/')
+-				mnt_dir = g_strdup_printf ("%s/", mnt.mnt_dir);
+-			else
+-				mnt_dir = g_strdup (mnt.mnt_dir);
+-
+-			autofs_mounts = g_slist_append (autofs_mounts,
+-							mnt_dir);
+-
+-
++		/* get major:minor of special device file */
++		if (stat (mnt.mnt_fsname, &statbuf) != 0)
+ 			continue;
+-		}
+ 
+-		/* check the underlying device of the mount point */
+-		if (stat (mnt.mnt_dir, &statbuf) != 0)
+-			continue;
+-		if (major(statbuf.st_dev) == 0)
++		if (major (statbuf.st_rdev) == 0)
+ 			continue;
+ 
+-		/*HAL_INFO (("* found mounts dev %s (%i:%i)", mnt.mnt_fsname, major(statbuf.st_dev), minor(statbuf.st_dev)));*/
++		/*HAL_INFO (("* found mounts dev %s (%i:%i)", mnt.mnt_fsname, major (statbuf.st_rdev), minor (statbuf.st_rdev)));*/
+ 		/* match against all hal volumes */
+ 		for (volume = volumes; volume != NULL; volume = g_slist_next (volume)) {
+ 			HalDevice *dev;
+@@ -235,10 +215,10 @@
+ 			if (major == 0)
+ 				continue;
+ 			minor = hal_device_property_get_int (dev, "block.minor");
+-			devt = makedev(major, minor);
++			devt = makedev (major, minor);
+ 			/*HAL_INFO (("  match %s (%i:%i)", hal_device_get_udi (dev), major, minor));*/
+ 
+-			if (statbuf.st_dev == devt) {
++			if (statbuf.st_rdev == devt) {
+ 				/* found entry for this device in /proc/mounts */
+ 				device_property_atomic_update_begin ();
+ 				hal_device_property_set_bool (dev, "volume.is_mounted", TRUE);
+@@ -255,9 +235,6 @@
+ 		}
+ 	}
+ 
+-	g_slist_foreach (autofs_mounts, (GFunc) g_free, NULL);
+-	g_slist_free (autofs_mounts);
+-
+ 	/* all remaining volumes are not mounted */
+ 	for (volume = volumes; volume != NULL; volume = g_slist_next (volume)) {
+ 		HalDevice *dev;

================================================================
Index: SOURCES/hal-dont-crash-on-cdrom-drives.patch
diff -u /dev/null SOURCES/hal-dont-crash-on-cdrom-drives.patch:1.1
--- /dev/null	Sun Mar  4 20:50:44 2007
+++ SOURCES/hal-dont-crash-on-cdrom-drives.patch	Sun Mar  4 20:50:39 2007
@@ -0,0 +1,15 @@
+diff -urN hal-0.5.8.1.orig/hald/linux/probing/probe-storage.c hal-0.5.8.1/hald/linux/probing/probe-storage.c
+--- hal-0.5.8.1.orig/hald/linux/probing/probe-storage.c	2007-03-04 18:57:02.987765366 +0100
++++ hal-0.5.8.1/hald/linux/probing/probe-storage.c	2007-03-04 19:00:20.347534611 +0100
+@@ -254,8 +254,10 @@
+ 						free (write_speeds);
+ 					}
+ 				} else {
++					gchar *wspeeds[1] = {NULL};
+ 					libhal_changeset_set_property_int (cs, "storage.cdrom.write_speed", 0);
+-					libhal_changeset_set_property_strlist (cs, "storage.cdrom.write_speeds", NULL);
++					libhal_changeset_set_property_strlist (cs, "storage.cdrom.write_speeds", 
++										    (const char **) wspeeds);
+ 				}
+ 			}
+ 			
================================================================


More information about the pld-cvs-commit mailing list