diff options
Diffstat (limited to 'sys-apps/hal/files/hal-0.4.4-iso_label_selection.patch')
-rw-r--r-- | sys-apps/hal/files/hal-0.4.4-iso_label_selection.patch | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/sys-apps/hal/files/hal-0.4.4-iso_label_selection.patch b/sys-apps/hal/files/hal-0.4.4-iso_label_selection.patch new file mode 100644 index 000000000000..42204c396dd1 --- /dev/null +++ b/sys-apps/hal/files/hal-0.4.4-iso_label_selection.patch @@ -0,0 +1,48 @@ +diff -uNr hal-0.4.4.orig/hald/linux/volume_id/volume_id.c hal-0.4.4/hald/linux/volume_id/volume_id.c +--- hal-0.4.4.orig/hald/linux/volume_id/volume_id.c 2005-01-07 16:25:58.000000000 +1300 ++++ hal-0.4.4/hald/linux/volume_id/volume_id.c 2005-01-12 13:19:06.930597976 +1300 +@@ -1245,10 +1245,14 @@ + return -1; + + if (strncmp(is->iso.id, "CD001", 5) == 0) { ++ char root_label[VOLUME_ID_LABEL_SIZE+1]; + int vd_offset; + int i; + __u8 found_svd; + ++ memset(root_label, 0, sizeof(root_label)); ++ strncpy(root_label, is->iso.volume_id, sizeof(root_label)-1); ++ + found_svd = 0; + vd_offset = ISO_VD_OFFSET; + for (i = 0; i < ISO_VD_MAX; i++) { +@@ -1258,22 +1262,19 @@ + break; + if (is->iso.type == ISO_VD_SUPPLEMENTARY) { + dbg("found ISO supplementary VD at offset 0x%x", off + vd_offset); ++ set_label_raw(id, is->iso.volume_id, 32); ++ set_label_unicode16(id, is->iso.volume_id, BE, 32); + found_svd = 1; + break; + } + vd_offset += ISO_SECTOR_SIZE; + } + +- if (!found_svd) { +- is = (union iso_super_block *) +- get_buffer(id, off + ISO_SUPERBLOCK_OFFSET, 0x200); +- if (is == NULL) +- return -1; +- set_label_raw(id, is->iso.volume_id, 32); +- set_label_string(id, is->iso.volume_id, 32); +- } else { +- set_label_raw(id, is->iso.volume_id, 32); +- set_label_unicode16(id, is->iso.volume_id, BE, 32); ++ if (!found_svd || ++ (found_svd && !strncmp(root_label, id->label, 16))) ++ { ++ set_label_raw(id, root_label, 32); ++ set_label_string(id, root_label, 32); + } + goto found; + } |