hal: Branch 'master' - 2 commits

David Zeuthen david at kemper.freedesktop.org
Mon Mar 26 13:15:58 PDT 2007


 hald/linux/probing/probe-volume.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletion(-)

New commits:
diff-tree c4f14a5ca83357d7607ae0bc76030a0254337478 (from parents)
Merge: 068fbbaaf1a74e4f175cb5595112f4c6966fea1c 81dccee799c57a6507321459cb08244db37a8e8d
Author: David Zeuthen <davidz at redhat.com>
Date:   Mon Mar 26 16:15:58 2007 -0400

    Merge branch 'master' of ssh://david@git.freedesktop.org/git/hal

diff-tree 068fbbaaf1a74e4f175cb5595112f4c6966fea1c (from 66bc00e332f4c99576d6c05c7cf5e9ad1d321404)
Author: Sjoerd Simons <sjoerd at luon.net>
Date:   Mon Mar 26 16:15:31 2007 -0400

    work around cdrom devices giving invalid TOC info
    
    A friend of mine has a silly dvd drive, which gives a wrong offset for
    certain discs[0] causing hal to fail when trying to detect a file
    system.
    
    Attached patches (one for master, one for 0.5.8) work around this be
    retrying detection at offset 0 when it fails at the reported offset.
    
      Sjoerd
    
    0: All dvd's we tried had an offset of 0 for their (only) session, but the drive
    indicated an offset of -150.

diff --git a/hald/linux/probing/probe-volume.c b/hald/linux/probing/probe-volume.c
index 1a255a7..489c15c 100644
--- a/hald/linux/probing/probe-volume.c
+++ b/hald/linux/probing/probe-volume.c
@@ -613,7 +613,16 @@ main (int argc, char *argv[])
 			int vid_ret;
 			HAL_INFO (("invoking volume_id_probe_all, offset=%d, size=%d", vol_probe_offset, vol_size));
 			vid_ret = volume_id_probe_all (vid, vol_probe_offset , vol_size);
-			HAL_INFO (("volume_id_probe_all returned %d"));
+			HAL_INFO (("volume_id_probe_all returned %d", vid_ret));
+
+			if (vid_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 */
+				HAL_INFO (("invoking volume_id_probe_all, offset=0, size=%d", vol_size));
+				vid_ret = volume_id_probe_all (vid, 0 , vol_size);
+				HAL_INFO (("volume_id_probe_all returned %d", vid_ret));
+			}
+
 			if (vid_ret == 0) {
 				set_volume_id_values(ctx, udi, cs, vid);
 				if (disc_may_have_data) {


More information about the hal-commit mailing list