[PATCH] make Magneto-Optical devices visible
Guillem Jover
guillem.jover at nokia.com
Fri Feb 13 10:39:07 PST 2009
Add missing breaks when probing MO volume types, so that the
volume.disc.type do not get shadowed by the CD-ROM case.
And when computing the volume display name, do not overwrite it just
after having handled the MO cases. This also fixes a memory leak.
---
hald/linux/probing/probe-volume.c | 2 ++
libhal-storage/libhal-storage.c | 2 ++
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/hald/linux/probing/probe-volume.c b/hald/linux/probing/probe-volume.c
index d298db2..8ce557e 100644
--- a/hald/linux/probing/probe-volume.c
+++ b/hald/linux/probing/probe-volume.c
@@ -476,8 +476,10 @@ main (int argc, char *argv[])
case 0x05: /* Advance Storage – Magneto-Optical */
libhal_changeset_set_property_string (cs, "volume.disc.type", "mo");
libhal_changeset_set_property_bool (cs, "volume.disc.is_rewritable", TRUE);
+ break;
case 0x04: /* Magneto Optical write once */
libhal_changeset_set_property_string (cs, "volume.disc.type", "mo");
+ break;
case 0x08: /* CD-ROM */
libhal_changeset_set_property_string (cs, "volume.disc.type", "cd_rom");
break;
diff --git a/libhal-storage/libhal-storage.c b/libhal-storage/libhal-storage.c
index 8b9e1b8..ea445b8 100644
--- a/libhal-storage/libhal-storage.c
+++ b/libhal-storage/libhal-storage.c
@@ -500,6 +500,8 @@ libhal_volume_policy_compute_display_name (LibHalDrive *drive, LibHalVolume *vol
else
name = strdup (_("Magneto Optical"));
}
+
+ goto out;
}
/* Fallback: size of media */
--
1.6.0.2
More information about the hal
mailing list