pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

sysutils/hal fixes



fix wrong or confusing message when disklabel not equal volume_id
and when disklabel is ufs and volume_id is vfat
also checks type != NULL BEFORE calling volume_id_get_type


==================================================================================

diff -up hald/netbsd/devinfo_mass.c.orig hald/netbsd/devinfo_mass.c
--- hald/netbsd/devinfo_mass.c.orig	2015-01-29 11:39:53.000000000 -0200
+++ hald/netbsd/devinfo_mass.c	2015-01-29 11:54:04.000000000 -0200
@@ -387,20 +387,22 @@ devinfo_mass_disklabel_add(HalDevice *pa
 	vid = volume_id_open_fd (fd);
 	if (vid) {
 		if (volume_id_probe_all (vid, 0, psize) == 0) {
-			char *type;
+			const char *type,*fstype;
 
 			hal_device_property_set_string (d, "volume.label", vid->label);
 			hal_device_property_set_string (d, "volume.partition.label", vid->label);
 			hal_device_property_set_string (d, "volume.uuid", vid->uuid);
 			hal_device_property_set_string (d, "volume.partition.uuid", vid->uuid);
 
-			if (volume_id_get_type (vid, &type) && type != NULL)
-				if (strcmp (type, "vfat") == 0) {
-					HAL_INFO (("%s disklabel reports %s but libvolume_id says it is "
-					    "%s, assuming disklabel is incorrect",
-					    devpath, devinfo_mass_get_fstype (part->p_fstype), type));
+			if ( type && volume_id_get_type (vid, &type)) {
+				fstype=devinfo_mass_get_fstype (part->p_fstype);
+				if (strcmp (type, fstype)) {
+					HAL_INFO (("%s disklabel reports [%s] but libvolume_id says it is "
+					    "[%s], assuming disklabel is incorrect",
+					    devpath, fstype, type));
 					hal_device_property_set_string (d, "volume.fstype", type);
 				}
+			}
 		}
 		volume_id_close (vid);
 	}





Home | Main Index | Thread Index | Old Index