X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/de355530ae67247cbd0da700edb3a2a1dae884c2..a3d08fcd5120d2aa8303b6349ca8b14e3f284af3:/bsd/hfs/hfscommon/BTree/BTreeScanner.c diff --git a/bsd/hfs/hfscommon/BTree/BTreeScanner.c b/bsd/hfs/hfscommon/BTree/BTreeScanner.c index 8cc50aaa1..06e15a807 100644 --- a/bsd/hfs/hfscommon/BTree/BTreeScanner.c +++ b/bsd/hfs/hfscommon/BTree/BTreeScanner.c @@ -22,6 +22,7 @@ * @(#)BTreeScanner.c */ #include +#include "../../hfs_endian.h" #include "../headers/BTreeScanner.h" @@ -179,6 +180,23 @@ static int FindNextLeafNode( BTScanState *scanState, Boolean avoidIO ) (u_int8_t *) scanState->currentNodePtr += scanState->btcb->nodeSize; } +#if BYTE_ORDER == LITTLE_ENDIAN + { + BlockDescriptor block; + FileReference fref; + + /* Fake a BlockDescriptor */ + block.buffer = scanState->currentNodePtr; + block.blockSize = scanState->btcb->nodeSize; + block.blockReadFromDisk = 1; + block.isModified = 0; + + fref = scanState->btcb->fileRefNum; + + SWAP_BT_NODE(&block, ISHFSPLUS(VTOVCB(fref)), VTOC(fref)->c_fileid, 0); + } +#endif + // Make sure this is a valid node if ( CheckNode( scanState->btcb, scanState->currentNodePtr ) != noErr ) {