[OpenBIOS] [PATCH] Fix HFS+ wrapper recognition issue

Programmingkid programmingkidx at gmail.com
Fri Dec 7 16:32:01 CET 2012


This patch fixes a problem with recognizing wrapped HFS+ volumes. This patch will eliminate the problem of seeing the file Where_have_all_my_files_gone? when listing the contents of a volume.


signed-off-by: John Arbuckle <programmingkidx at gmail.com>

Index: trunk/openbios-devel/fs/hfsplus/hfsp_volume.c
===================================================================
--- trunk/openbios-devel/fs/hfsplus/hfsp_volume.c	(revision 1075)
+++ trunk/openbios-devel/fs/hfsplus/hfsp_volume.c	(working copy)
@@ -305,13 +305,14 @@
 {
 	UInt16 *vol;
 	int ret = 0;
+	#define wrapper_offset 0x3e
 
 	vol = (UInt16 *)malloc(2 * 1 << HFSP_BLOCKSZ_BITS);
 	os_seek_offset( fd, 2 * (1 << HFSP_BLOCKSZ_BITS) + offset );
 	os_read(fd, vol, 2, HFSP_BLOCKSZ_BITS);
 
 	if (__be16_to_cpu(vol[0]) == HFS_VOLHEAD_SIG &&
-		__be16_to_cpu(vol[0x7c]) == HFSP_VOLHEAD_SIG) {
+		__be16_to_cpu(vol[wrapper_offset]) == HFSP_VOLHEAD_SIG) {
 		ret = -1;
 	} else if (__be16_to_cpu(vol[0]) == HFSP_VOLHEAD_SIG) {
 		ret = -1;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openbios.org/pipermail/openbios/attachments/20121207/3b2d84b3/attachment.html>


More information about the OpenBIOS mailing list