commit 43e26dadd6610b8782248d7af727a7525fd55be6 Author: Sjoerd Simons Date: Wed Mar 7 23:21:54 2007 +0100 work around cd drives giving wrong TOC info Some cd/dvd drives give out wrong information when requesting the session offset of certain drives. This causes hal to probe for a filesystem at the wrong offset. Work around that by retrying the filesystem probe at offset 0 for discs if it failed. diff --git a/hald/linux/probing/probe-volume.c b/hald/linux/probing/probe-volume.c index a87bd31..d0f7354 100644 --- a/hald/linux/probing/probe-volume.c +++ b/hald/linux/probing/probe-volume.c @@ -586,7 +586,16 @@ main (int argc, char *argv[]) /* probe for file system */ vid = volume_id_open_fd (fd); if (vid != NULL) { - if (volume_id_probe_all (vid, vol_probe_offset , vol_size) == 0) { + int ret; + + ret = volume_id_probe_all (vid, vol_probe_offset , vol_size); + if (ret != 0 && is_disc && vol_probe_offset != 0) { + /* Some cd-rom drives report the offset of the session in the cd's TOC wrong. + * Fallback to probing at offset 0, just to be sure */ + ret = volume_id_probe_all (vid, 0 , vol_size); + } + + if (ret == 0) { set_volume_id_values(ctx, udi, cs, vid); } else { libhal_changeset_set_property_string (cs, "info.product", "Volume");