/packages/sysutils/diskdev_cmds/patches/diskdev_cmds-332.14-main.patch

http://github.com/OpenELEC/OpenELEC.tv · Patch · 2713 lines · 2554 code · 159 blank · 0 comment · 0 complexity · 26a2fbca3cb0cb14e8109b25084f81d1 MD5 · raw file

Large files are truncated click here to view the full file

  1. diff -druN diskdev_cmds-332.14/fsck_hfs.tproj/cache.c diskdev_cmds-332.14-patched/fsck_hfs.tproj/cache.c
  2. --- diskdev_cmds-332.14/fsck_hfs.tproj/cache.c 2006-02-20 22:45:15.000000000 +0100
  3. +++ diskdev_cmds-332.14-patched/fsck_hfs.tproj/cache.c 2008-07-01 22:30:11.000000000 +0200
  4. @@ -26,7 +26,11 @@
  5. #include <stdlib.h>
  6. #include <sys/mman.h>
  7. #include <sys/stat.h>
  8. +#if LINUX
  9. +#include "missing.h"
  10. +#else
  11. #include <sys/types.h>
  12. +#endif /* __LINUX__ */
  13. #include <sys/uio.h>
  14. #include <unistd.h>
  15. #include <string.h>
  16. Files diskdev_cmds-332.14/fsck_hfs.tproj/cache.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/cache.o differ
  17. diff -druN diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/BlockCache.c diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/BlockCache.c
  18. --- diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/BlockCache.c 2006-02-20 22:45:15.000000000 +0100
  19. +++ diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/BlockCache.c 2008-07-01 22:30:11.000000000 +0200
  20. @@ -20,6 +20,9 @@
  21. * @APPLE_LICENSE_HEADER_END@
  22. */
  23. +#if LINUX
  24. +#include "missing.h"
  25. +#endif
  26. #include "SRuntime.h"
  27. #include "Scavenger.h"
  28. #include "../cache.h"
  29. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/BlockCache.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/BlockCache.o differ
  30. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/BTreeAllocate.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/BTreeAllocate.o differ
  31. diff -druN diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/BTree.c diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/BTree.c
  32. --- diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/BTree.c 2006-02-20 22:45:15.000000000 +0100
  33. +++ diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/BTree.c 2008-07-01 22:30:11.000000000 +0200
  34. @@ -1705,7 +1705,9 @@
  35. UInt16 version,
  36. BTreeInfoRec *info )
  37. {
  38. +#if !LINUX
  39. #pragma unused (version)
  40. +#endif
  41. BTreeControlBlockPtr btreePtr;
  42. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/BTreeMiscOps.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/BTreeMiscOps.o differ
  43. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/BTreeNodeOps.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/BTreeNodeOps.o differ
  44. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/BTree.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/BTree.o differ
  45. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/BTreeScanner.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/BTreeScanner.o differ
  46. diff -druN diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/BTreeTreeOps.c diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
  47. --- diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/BTreeTreeOps.c 2006-02-20 22:45:15.000000000 +0100
  48. +++ diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/BTreeTreeOps.c 2008-07-01 22:30:11.000000000 +0200
  49. @@ -223,7 +223,7 @@
  50. //
  51. if (curNodeNum == 0)
  52. {
  53. -// Panic("\pSearchTree: curNodeNum is zero!");
  54. + Panic("SearchTree: curNodeNum is zero!");
  55. err = fsBTInvalidNodeErr;
  56. goto ErrorExit;
  57. }
  58. @@ -433,7 +433,7 @@
  59. M_ExitOnError (err);
  60. if ( DEBUG_BUILD && updateParent && newRoot )
  61. - DebugStr("\p InsertLevel: New root from primary key, update from secondary key...");
  62. + DebugStr("InsertLevel: New root from primary key, update from secondary key...");
  63. }
  64. //////////////////////// Update Parent(s) ///////////////////////////////
  65. @@ -448,7 +448,7 @@
  66. secondaryKey = nil;
  67. - PanicIf ( (level == btreePtr->treeDepth), "\p InsertLevel: unfinished insert!?");
  68. + PanicIf ( (level == btreePtr->treeDepth), "InsertLevel: unfinished insert!?");
  69. ++level;
  70. @@ -456,7 +456,7 @@
  71. index = treePathTable [level].index;
  72. parentNodeNum = treePathTable [level].node;
  73. - PanicIf ( parentNodeNum == 0, "\p InsertLevel: parent node is zero!?");
  74. + PanicIf ( parentNodeNum == 0, "InsertLevel: parent node is zero!?");
  75. err = GetNode (btreePtr, parentNodeNum, &parentNode); // released as target node in next level up
  76. M_ExitOnError (err);
  77. @@ -470,7 +470,7 @@
  78. {
  79. //ее╩debug: check if ptr == targetNodeNum
  80. GetRecordByIndex (btreePtr, parentNode.buffer, index, &keyPtr, &recPtr, &recSize);
  81. - PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, "\p InsertLevel: parent ptr doesn't match target node!");
  82. + PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, "InsertLevel: parent ptr doesn't match target node!");
  83. // need to delete and re-insert this parent key/ptr
  84. // we delete it here and it gets re-inserted in the
  85. @@ -532,7 +532,7 @@
  86. (void) ReleaseNode (btreePtr, targetNode);
  87. (void) ReleaseNode (btreePtr, &siblingNode);
  88. - Panic ("\p InsertLevel: an error occured!");
  89. + Panic ("InsertLevel: an error occured!");
  90. return err;
  91. @@ -566,7 +566,7 @@
  92. *rootSplit = false;
  93. - PanicIf ( targetNode->buffer == siblingNode->buffer, "\p InsertNode: targetNode == siblingNode, huh?");
  94. + PanicIf ( targetNode->buffer == siblingNode->buffer, "InsertNode: targetNode == siblingNode, huh?");
  95. leftNodeNum = ((NodeDescPtr) targetNode->buffer)->bLink;
  96. rightNodeNum = ((NodeDescPtr) targetNode->buffer)->fLink;
  97. @@ -606,7 +606,7 @@
  98. if ( leftNodeNum > 0 )
  99. {
  100. - PanicIf ( siblingNode->buffer != nil, "\p InsertNode: siblingNode already aquired!");
  101. + PanicIf ( siblingNode->buffer != nil, "InsertNode: siblingNode already aquired!");
  102. if ( siblingNode->buffer == nil )
  103. {
  104. @@ -614,7 +614,7 @@
  105. M_ExitOnError (err);
  106. }
  107. - PanicIf ( ((NodeDescPtr) siblingNode->buffer)->fLink != nodeNum, "\p InsertNode, RotateLeft: invalid sibling link!" );
  108. + PanicIf ( ((NodeDescPtr) siblingNode->buffer)->fLink != nodeNum, "InsertNode, RotateLeft: invalid sibling link!" );
  109. if ( !key->skipRotate ) // are rotates allowed?
  110. {
  111. @@ -703,7 +703,7 @@
  112. targetNodeNum = treePathTable[level].node;
  113. targetNodePtr = targetNode->buffer;
  114. - PanicIf (targetNodePtr == nil, "\pDeleteTree: targetNode has nil buffer!");
  115. + PanicIf (targetNodePtr == nil, "DeleteTree: targetNode has nil buffer!");
  116. DeleteRecord (btreePtr, targetNodePtr, index);
  117. @@ -797,7 +797,7 @@
  118. //ее╩debug: check if ptr == targetNodeNum
  119. GetRecordByIndex (btreePtr, parentNode.buffer, index, &keyPtr, &recPtr, &recSize);
  120. - PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, "\p DeleteTree: parent ptr doesn't match targetNodeNum!!");
  121. + PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, " DeleteTree: parent ptr doesn't match targetNodeNum!!");
  122. // need to delete and re-insert this parent key/ptr
  123. DeleteRecord (btreePtr, parentNode.buffer, index);
  124. @@ -1018,7 +1018,7 @@
  125. keyPtr, keyLength, recPtr, recSize);
  126. if ( !didItFit )
  127. {
  128. - Panic ("\pRotateLeft: InsertKeyRecord (left) returned false!");
  129. + Panic ("RotateLeft: InsertKeyRecord (left) returned false!");
  130. err = fsBTBadRotateErr;
  131. goto ErrorExit;
  132. }
  133. @@ -1031,7 +1031,7 @@
  134. didItFit = RotateRecordLeft (btreePtr, leftNode, rightNode);
  135. if ( !didItFit )
  136. {
  137. - Panic ("\pRotateLeft: RotateRecordLeft returned false!");
  138. + Panic ("RotateLeft: RotateRecordLeft returned false!");
  139. err = fsBTBadRotateErr;
  140. goto ErrorExit;
  141. }
  142. @@ -1048,7 +1048,7 @@
  143. keyPtr, keyLength, recPtr, recSize);
  144. if ( !didItFit )
  145. {
  146. - Panic ("\pRotateLeft: InsertKeyRecord (right) returned false!");
  147. + Panic ("RotateLeft: InsertKeyRecord (right) returned false!");
  148. err = fsBTBadRotateErr;
  149. goto ErrorExit;
  150. }
  151. @@ -1117,7 +1117,7 @@
  152. right = rightNode->buffer;
  153. left = leftNode->buffer;
  154. - PanicIf ( right->bLink != 0 && left == 0, "\p SplitLeft: left sibling missing!?" );
  155. + PanicIf ( right->bLink != 0 && left == 0, " SplitLeft: left sibling missing!?" );
  156. //ее type should be kLeafNode or kIndexNode
  157. @@ -1240,8 +1240,8 @@
  158. Boolean didItFit;
  159. UInt16 keyLength;
  160. - PanicIf (leftNode == nil, "\pAddNewRootNode: leftNode == nil");
  161. - PanicIf (rightNode == nil, "\pAddNewRootNode: rightNode == nil");
  162. + PanicIf (leftNode == nil, "AddNewRootNode: leftNode == nil");
  163. + PanicIf (rightNode == nil, "AddNewRootNode: rightNode == nil");
  164. /////////////////////// Initialize New Root Node ////////////////////////////
  165. @@ -1264,7 +1264,7 @@
  166. didItFit = InsertKeyRecord ( btreePtr, rootNode.buffer, 0, keyPtr, keyLength,
  167. (UInt8 *) &rightNode->bLink, 4 );
  168. - PanicIf ( !didItFit, "\pAddNewRootNode:InsertKeyRecord failed for left index record");
  169. + PanicIf ( !didItFit, "AddNewRootNode:InsertKeyRecord failed for left index record");
  170. //////////////////// Insert Right Node Index Record /////////////////////////
  171. @@ -1275,7 +1275,7 @@
  172. didItFit = InsertKeyRecord ( btreePtr, rootNode.buffer, 1, keyPtr, keyLength,
  173. (UInt8 *) &leftNode->fLink, 4 );
  174. - PanicIf ( !didItFit, "\pAddNewRootNode:InsertKeyRecord failed for right index record");
  175. + PanicIf ( !didItFit, "AddNewRootNode:InsertKeyRecord failed for right index record");
  176. #if DEBUG_TREEOPS
  177. @@ -1355,7 +1355,7 @@
  178. }
  179. rightPtr = rightNodePtr->buffer;
  180. - PanicIf ( leftPtr->fLink != 0 && rightPtr == 0, "\p SplitRight: right sibling missing!?" );
  181. + PanicIf ( leftPtr->fLink != 0 && rightPtr == 0, "SplitRight: right sibling missing!?" );
  182. //ее type should be kLeafNode or kIndexNode
  183. @@ -1557,7 +1557,7 @@
  184. keyPtr, keyLength, recPtr, recSize);
  185. if ( !didItFit )
  186. {
  187. - Panic ("\pRotateRight: InsertKeyRecord (left) returned false!");
  188. + Panic ("RotateRight: InsertKeyRecord (left) returned false!");
  189. err = fsBTBadRotateErr;
  190. goto ErrorExit;
  191. }
  192. @@ -1572,7 +1572,7 @@
  193. didItFit = RotateRecordRight( btreePtr, leftNodePtr, rightNodePtr );
  194. if ( !didItFit )
  195. {
  196. - Panic ("\pRotateRight: RotateRecordRight returned false!");
  197. + Panic ("RotateRight: RotateRecordRight returned false!");
  198. err = fsBTBadRotateErr;
  199. goto ErrorExit;
  200. }
  201. @@ -1583,7 +1583,7 @@
  202. keyPtr, keyLength, recPtr, recSize);
  203. if ( !didItFit )
  204. {
  205. - Panic ("\pRotateRight: InsertKeyRecord (left) returned false!");
  206. + Panic ("RotateRight: InsertKeyRecord (left) returned false!");
  207. err = fsBTBadRotateErr;
  208. goto ErrorExit;
  209. }
  210. @@ -1607,7 +1607,7 @@
  211. keyPtr, keyLength, recPtr, recSize);
  212. if ( !didItFit )
  213. {
  214. - Panic ("\pRotateRight: InsertKeyRecord (right) returned false!");
  215. + Panic ("RotateRight: InsertKeyRecord (right) returned false!");
  216. err = fsBTBadRotateErr;
  217. goto ErrorExit;
  218. }
  219. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/BTreeTreeOps.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/BTreeTreeOps.o differ
  220. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/CatalogCheck.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/CatalogCheck.o differ
  221. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/HardLinkCheck.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/HardLinkCheck.o differ
  222. diff -druN diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/hfs_endian.c diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/hfs_endian.c
  223. --- diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/hfs_endian.c 2006-02-20 22:45:15.000000000 +0100
  224. +++ diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/hfs_endian.c 2008-07-02 00:10:48.000000000 +0200
  225. @@ -31,7 +31,11 @@
  226. #include <sys/types.h>
  227. #include <sys/stat.h>
  228. +#if LINUX
  229. +#include "missing.h"
  230. +#else
  231. #include <architecture/byte_order.h>
  232. +#endif
  233. #include <hfs/hfs_format.h>
  234. #include "Scavenger.h"
  235. @@ -194,7 +198,7 @@
  236. BTNodeDescriptor *srcDesc = src->buffer;
  237. BTreeControlBlockPtr btcb = fcb->fcbBtree;
  238. UInt16 *srcOffs = NULL;
  239. - UInt32 i;
  240. + int i;
  241. int error = 0;
  242. // WriteError(fcb->fcbVolume->vcbGPtr, E_BadNode, fcb->fcbFileID, src->blockNum);
  243. @@ -433,7 +437,7 @@
  244. BTNodeDescriptor *srcDesc = src->buffer;
  245. UInt16 *srcOffs = (UInt16 *)((char *)src->buffer + (src->blockSize - (srcDesc->numRecords * sizeof (UInt16))));
  246. char *nextRecord; /* Points to start of record following current one */
  247. - UInt32 i;
  248. + int i;
  249. UInt32 j;
  250. if (fileID == kHFSExtentsFileID) {
  251. @@ -559,7 +563,7 @@
  252. /* Make sure name length is consistent with key length */
  253. if (keyLength < sizeof(srcKey->parentID) + sizeof(srcKey->nodeName.length) +
  254. srcKey->nodeName.length*sizeof(srcKey->nodeName.unicode[0])) {
  255. - if (debug) printf("hfs_swap_HFSPlusBTInternalNode: catalog record #%d keyLength=%d expected=%lu\n",
  256. + if (debug) printf("hfs_swap_HFSPlusBTInternalNode: catalog record #%d keyLength=%d expected=%i\n",
  257. srcDesc->numRecords-i, keyLength, sizeof(srcKey->parentID) + sizeof(srcKey->nodeName.length) +
  258. srcKey->nodeName.length*sizeof(srcKey->nodeName.unicode[0]));
  259. WriteError(fcb->fcbVolume->vcbGPtr, E_KeyLen, fcb->fcbFileID, src->blockNum);
  260. @@ -854,7 +858,7 @@
  261. UInt16 *srcOffs = (UInt16 *)((char *)src->buffer + (src->blockSize - (srcDesc->numRecords * sizeof (UInt16))));
  262. char *nextRecord; /* Points to start of record following current one */
  263. - UInt32 i;
  264. + int i;
  265. UInt32 j;
  266. if (fileID == kHFSExtentsFileID) {
  267. diff -druN diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/hfs_endian.h diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/hfs_endian.h
  268. --- diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/hfs_endian.h 2006-02-20 22:45:15.000000000 +0100
  269. +++ diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/hfs_endian.h 2008-07-01 22:30:11.000000000 +0200
  270. @@ -27,9 +27,14 @@
  271. *
  272. * This file prototypes endian swapping routines for the HFS/HFS Plus
  273. * volume format.
  274. - */
  275. +*/
  276. #include <hfs/hfs_format.h>
  277. +#if LINUX
  278. +#include <endian.h>
  279. +#include <byteswap.h>
  280. +#else
  281. #include <architecture/byte_order.h>
  282. +#endif
  283. #include "SRuntime.h"
  284. /*********************/
  285. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/hfs_endian.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/hfs_endian.o differ
  286. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/libdfa.a and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/libdfa.a differ
  287. diff -druN diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/Makefile.lnx diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/Makefile.lnx
  288. --- diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/Makefile.lnx 1970-01-01 01:00:00.000000000 +0100
  289. +++ diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/Makefile.lnx 2008-07-01 22:30:11.000000000 +0200
  290. @@ -0,0 +1,15 @@
  291. +CFILES = hfs_endian.c BlockCache.c\
  292. + BTree.c BTreeAllocate.c BTreeMiscOps.c \
  293. + BTreeNodeOps.c BTreeScanner.c BTreeTreeOps.c\
  294. + CatalogCheck.c HardLinkCheck.c\
  295. + SBTree.c SControl.c SVerify1.c SVerify2.c\
  296. + SRepair.c SRebuildCatalogBTree.c\
  297. + SUtils.c SKeyCompare.c SDevice.c SExtents.c SAllocate.c\
  298. + SCatalog.c SStubs.c VolumeBitmapCheck.c
  299. +OFILES = $(CFILES:.c=.o)
  300. +
  301. +libdfa.a: $(OFILES)
  302. + $(AR) rc $@ $?
  303. +
  304. +clean:
  305. + $(RM) $(OFILES) libdfa.a
  306. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SAllocate.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SAllocate.o differ
  307. diff -druN diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SBTree.c diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SBTree.c
  308. --- diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SBTree.c 2006-02-20 22:45:15.000000000 +0100
  309. +++ diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SBTree.c 2008-07-01 22:30:11.000000000 +0200
  310. @@ -93,7 +93,7 @@
  311. CopyMemory(&resultIterator->key, foundKey, CalcKeySize(btcb, &resultIterator->key)); //ее warning, this could overflow user's buffer!!!
  312. if ( DEBUG_BUILD && !ValidHFSRecord(data, btcb, *dataSize) )
  313. - DebugStr("\pSearchBTreeRecord: bad record?");
  314. + DebugStr("SearchBTreeRecord: bad record?");
  315. }
  316. ErrorExit:
  317. @@ -190,7 +190,7 @@
  318. CopyMemory(&iterator->key, key, CalcKeySize(btcb, &iterator->key)); //ее warning, this could overflow user's buffer!!!
  319. if ( DEBUG_BUILD && !ValidHFSRecord(data, btcb, *dataSize) )
  320. - DebugStr("\pGetBTreeRecord: bad record?");
  321. + DebugStr("GetBTreeRecord: bad record?");
  322. }
  323. @@ -222,7 +222,7 @@
  324. CopyMemory(key, &iterator.key, CalcKeySize(btcb, (BTreeKey *) key)); //ее should we range check against maxkeylen?
  325. if ( DEBUG_BUILD && !ValidHFSRecord(data, btcb, dataSize) )
  326. - DebugStr("\pInsertBTreeRecord: bad record?");
  327. + DebugStr("InsertBTreeRecord: bad record?");
  328. result = BTInsertRecord( fcb, &iterator, &btRecord, dataSize );
  329. @@ -284,7 +284,7 @@
  330. CopyMemory(key, &iterator.key, CalcKeySize(btcb, (BTreeKey *) key)); //ее should we range check against maxkeylen?
  331. if ( DEBUG_BUILD && !ValidHFSRecord(newData, btcb, dataSize) )
  332. - DebugStr("\pReplaceBTreeRecord: bad record?");
  333. + DebugStr("ReplaceBTreeRecord: bad record?");
  334. result = BTReplaceRecord( fcb, &iterator, &btRecord, dataSize );
  335. @@ -301,7 +301,9 @@
  336. OSStatus
  337. SetEndOfForkProc ( SFCB *filePtr, FSSize minEOF, FSSize maxEOF )
  338. {
  339. +#if !LINUX
  340. #pragma unused (maxEOF)
  341. +#endif
  342. OSStatus result;
  343. UInt32 actualSectorsAdded;
  344. @@ -321,7 +323,7 @@
  345. else
  346. {
  347. if ( DEBUG_BUILD )
  348. - DebugStr("\pSetEndOfForkProc: minEOF is smaller than current size!");
  349. + DebugStr("SetEndOfForkProc: minEOF is smaller than current size!");
  350. return -1;
  351. }
  352. @@ -347,7 +349,7 @@
  353. // Make sure we got at least as much space as we needed
  354. //
  355. if (filePtr->fcbLogicalSize < minEOF) {
  356. - Panic("\pSetEndOfForkProc: disk too full to extend B-tree file");
  357. + Panic("SetEndOfForkProc: disk too full to extend B-tree file");
  358. return dskFulErr;
  359. }
  360. @@ -419,7 +421,7 @@
  361. if ( (keyLen < 6) || (keyLen > btcb->maxKeyLength) )
  362. {
  363. if ( DEBUG_BUILD )
  364. - DebugStr("\pCheckBTreeKey: bad key length!");
  365. + DebugStr("CheckBTreeKey: bad key length!");
  366. return fsBTInvalidKeyLengthErr;
  367. }
  368. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SBTree.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SBTree.o differ
  369. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SCatalog.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SCatalog.o differ
  370. diff -druN diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/Scavenger.h diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/Scavenger.h
  371. --- diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/Scavenger.h 2006-02-20 22:45:15.000000000 +0100
  372. +++ diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/Scavenger.h 2008-07-01 22:30:11.000000000 +0200
  373. @@ -35,11 +35,16 @@
  374. #include "BTreeScanner.h"
  375. #include "hfs_endian.h"
  376. +#if LINUX
  377. +#define XATTR_MAXNAMELEN 127
  378. +#include <limits.h>
  379. +#else
  380. #include <sys/xattr.h>
  381. #include <sys/acl.h>
  382. #include <sys/kauth.h>
  383. -#include <sys/errno.h>
  384. #include <sys/syslimits.h>
  385. +#endif
  386. +#include <sys/errno.h>
  387. #ifdef __cplusplus
  388. extern "C" {
  389. @@ -1434,4 +1439,8 @@
  390. };
  391. #endif
  392. +#if LINUX
  393. +#undef XATTR_MAXNAMELEN
  394. +#endif
  395. +
  396. #endif /* __SCAVENGER__ */
  397. diff -druN diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SControl.c diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SControl.c
  398. --- diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SControl.c 2006-02-20 22:45:15.000000000 +0100
  399. +++ diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SControl.c 2008-07-01 22:30:11.000000000 +0200
  400. @@ -739,7 +739,7 @@
  401. pointer = (ScavStaticStructures *) AllocateClearMemory( sizeof(ScavStaticStructures) );
  402. if ( pointer == nil ) {
  403. if ( GPtr->logLevel >= kDebugLog ) {
  404. - printf( "\t error %d - could not allocate %ld bytes of memory \n",
  405. + printf( "\t error %d - could not allocate %i bytes of memory \n",
  406. R_NoMem, sizeof(ScavStaticStructures) );
  407. }
  408. return( R_NoMem );
  409. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SControl.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SControl.o differ
  410. diff -druN diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SDevice.c diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SDevice.c
  411. --- diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SDevice.c 2006-02-20 22:45:15.000000000 +0100
  412. +++ diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SDevice.c 2008-07-01 22:30:11.000000000 +0200
  413. @@ -28,24 +28,61 @@
  414. #include <unistd.h>
  415. #include <errno.h>
  416. #include <sys/ioctl.h>
  417. -
  418. +#if LINUX
  419. +#include <fcntl.h>
  420. +#include <sys/stat.h>
  421. +#else
  422. #include <IOKit/storage/IOMediaBSDClient.h>
  423. -
  424. +#endif /* LINUX */
  425. #else
  426. -
  427. #include <Files.h>
  428. #include <Device.h>
  429. #include <Disks.h>
  430. -#endif
  431. -
  432. +#endif
  433. OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize)
  434. {
  435. #if BSD
  436. UInt64 devBlockCount = 0;
  437. int devBlockSize = 0;
  438. +#if LINUX
  439. + struct stat stbuf;
  440. +
  441. + devBlockSize = 512;
  442. +#ifndef BLKGETSIZE
  443. +#define BLKGETSIZE _IO(0x12,96)
  444. +#endif
  445. +#ifndef BLKGETSIZE64
  446. +#define BLKGETSIZE64 _IOR(0x12,114,size_t)
  447. +#endif
  448. + if (fstat(driveRefNum, &stbuf) < 0){
  449. + printf("Error: %s\n", strerror(errno));
  450. + return(-1);
  451. + }
  452. +
  453. + if (S_ISREG(stbuf.st_mode)) {
  454. + devBlockCount = stbuf.st_size / 512;
  455. + }
  456. + else if (S_ISBLK(stbuf.st_mode)) {
  457. + unsigned long size;
  458. + u_int64_t size64;
  459. + if (!ioctl(driveRefNum, BLKGETSIZE64, &size64))
  460. + devBlockCount = size64 / 512;
  461. + else if (!ioctl(driveRefNum, BLKGETSIZE, &size))
  462. + devBlockCount = size;
  463. + else{
  464. + printf("Error: %s\n", strerror(errno));
  465. + return(-1);
  466. + }
  467. +
  468. + }
  469. + else{
  470. + printf("Device is not a block device");
  471. + return(-1);
  472. + }
  473. +#elif BSD
  474. if (ioctl(driveRefNum, DKIOCGETBLOCKCOUNT, &devBlockCount) < 0) {
  475. printf("ioctl(DKIOCGETBLOCKCOUNT) for fd %d: %s\n", driveRefNum, strerror(errno));
  476. return (-1);
  477. @@ -55,6 +92,7 @@
  478. printf("ioctl(DKIOCGETBLOCKSIZE) for fd %d: %s\n", driveRefNum, strerror(errno));
  479. return (-1);
  480. }
  481. +#endif /* BSD */
  482. if (devBlockSize != 512) {
  483. *numBlocks = (devBlockCount * (UInt64)devBlockSize) / 512;
  484. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SDevice.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SDevice.o differ
  485. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SExtents.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SExtents.o differ
  486. diff -druN diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SKeyCompare.c diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SKeyCompare.c
  487. --- diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SKeyCompare.c 2006-02-20 22:45:15.000000000 +0100
  488. +++ diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SKeyCompare.c 2008-07-01 22:30:11.000000000 +0200
  489. @@ -454,7 +454,9 @@
  490. * The name portion of the key is compared using a 16-bit binary comparison.
  491. * This is called from the b-tree code.
  492. */
  493. +#if !LINUX
  494. __private_extern__
  495. +#endif
  496. SInt32
  497. CompareAttributeKeys(const AttributeKey *searchKey, const AttributeKey *trialKey)
  498. {
  499. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SKeyCompare.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SKeyCompare.o differ
  500. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SRebuildCatalogBTree.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SRebuildCatalogBTree.o differ
  501. diff -druN diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SRepair.c diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SRepair.c
  502. --- diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SRepair.c 2006-02-20 22:45:15.000000000 +0100
  503. +++ diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SRepair.c 2008-07-01 22:30:11.000000000 +0200
  504. @@ -1593,7 +1593,9 @@
  505. static OSErr FixWrapperExtents( SGlobPtr GPtr, RepairOrderPtr p )
  506. {
  507. +#if !LINUX
  508. #pragma unused (p)
  509. +#endif
  510. OSErr err;
  511. HFSMasterDirectoryBlock *mdb;
  512. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SRepair.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SRepair.o differ
  513. diff -druN diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SRuntime.h diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SRuntime.h
  514. --- diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SRuntime.h 2006-02-20 22:45:15.000000000 +0100
  515. +++ diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SRuntime.h 2008-07-01 22:30:11.000000000 +0200
  516. @@ -27,8 +27,11 @@
  517. #define __SRUNTIME__
  518. #if BSD
  519. -
  520. +#if LINUX
  521. +#include "missing.h"
  522. +#else
  523. #include <sys/types.h>
  524. +#endif
  525. #include <stdlib.h>
  526. #include <string.h>
  527. #include <stdio.h>
  528. @@ -91,10 +94,12 @@
  529. typedef u_int32_t HFSCatalogNodeID;
  530. +#if !LINUX
  531. enum {
  532. false = 0,
  533. true = 1
  534. };
  535. +#endif
  536. /* OS error codes */
  537. enum {
  538. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SStubs.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SStubs.o differ
  539. diff -druN diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SUtils.c diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SUtils.c
  540. --- diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SUtils.c 2006-02-20 22:45:15.000000000 +0100
  541. +++ diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SUtils.c 2008-07-01 22:30:11.000000000 +0200
  542. @@ -380,7 +380,8 @@
  543. // GPtr->realVCB Real in-memory vcb
  544. //------------------------------------------------------------------------------
  545. -#if !BSD
  546. +#if BSD
  547. +#if !LINUX
  548. OSErr GetVolumeFeatures( SGlobPtr GPtr )
  549. {
  550. OSErr err;
  551. @@ -418,7 +419,7 @@
  552. return( noErr );
  553. }
  554. #endif
  555. -
  556. +#endif
  557. /*-------------------------------------------------------------------------------
  558. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SUtils.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SUtils.o differ
  559. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SVerify1.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SVerify1.o differ
  560. diff -druN diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SVerify2.c diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SVerify2.c
  561. --- diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SVerify2.c 2006-02-20 22:45:15.000000000 +0100
  562. +++ diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SVerify2.c 2008-07-01 22:30:11.000000000 +0200
  563. @@ -32,7 +32,9 @@
  564. */
  565. #include <sys/ioctl.h>
  566. +#if !LINUX
  567. #include <sys/disk.h>
  568. +#endif
  569. #include "BTree.h"
  570. #include "BTreePrivate.h"
  571. @@ -1240,8 +1242,13 @@
  572. * clump size for read-only media is irrelevant we skip the clump size
  573. * check to avoid non useful warnings.
  574. */
  575. +#if LINUX
  576. + // FIXME
  577. + isWriteable = 1;
  578. +#else
  579. isWriteable = 0;
  580. ioctl( GPtr->DrvNum, DKIOCISWRITABLE, &isWriteable );
  581. +#endif
  582. if ( isWriteable != 0 &&
  583. volumeHeader->catalogFile.clumpSize != vcb->vcbCatalogFile->fcbClumpSize ) {
  584. PrintError(GPtr, E_InvalidClumpSize, 0);
  585. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SVerify2.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/SVerify2.o differ
  586. Files diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/VolumeBitmapCheck.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/dfalib/VolumeBitmapCheck.o differ
  587. Files diskdev_cmds-332.14/fsck_hfs.tproj/fsck_hfs and diskdev_cmds-332.14-patched/fsck_hfs.tproj/fsck_hfs differ
  588. diff -druN diskdev_cmds-332.14/fsck_hfs.tproj/fsck_hfs.c diskdev_cmds-332.14-patched/fsck_hfs.tproj/fsck_hfs.c
  589. --- diskdev_cmds-332.14/fsck_hfs.tproj/fsck_hfs.c 2006-02-20 22:45:15.000000000 +0100
  590. +++ diskdev_cmds-332.14-patched/fsck_hfs.tproj/fsck_hfs.c 2008-07-01 22:36:12.000000000 +0200
  591. @@ -24,10 +24,14 @@
  592. #include <sys/types.h>
  593. #include <sys/stat.h>
  594. #include <sys/param.h>
  595. +#if !LINUX
  596. #include <sys/ucred.h>
  597. +#endif
  598. #include <sys/mount.h>
  599. #include <sys/ioctl.h>
  600. +#if !LINUX
  601. #include <sys/disk.h>
  602. +#endif
  603. #include <hfs/hfs_mount.h>
  604. @@ -105,7 +109,7 @@
  605. else
  606. progname = *argv;
  607. - while ((ch = getopt(argc, argv, "dfglm:npqruy")) != EOF) {
  608. + while ((ch = getopt(argc, argv, "dfglm:napqruy")) != EOF) {
  609. switch (ch) {
  610. case 'd':
  611. debug++;
  612. @@ -141,6 +145,7 @@
  613. yflag = 0;
  614. break;
  615. + case 'a':
  616. case 'p':
  617. preen++;
  618. break;
  619. @@ -170,10 +175,12 @@
  620. if (guiControl)
  621. debug = 0; /* debugging is for command line only */
  622. -
  623. +#if LINUX
  624. +// FIXME
  625. +#else
  626. if (signal(SIGINT, SIG_IGN) != SIG_IGN)
  627. (void)signal(SIGINT, catch);
  628. -
  629. +#endif
  630. if (argc < 1) {
  631. (void) fprintf(stderr, "%s: missing special-device\n", progname);
  632. usage();
  633. @@ -194,7 +201,9 @@
  634. int chkLev, repLev, logLev;
  635. int blockDevice_fd, canWrite;
  636. char *unraw, *mntonname;
  637. +#if !LINUX
  638. struct statfs *fsinfo;
  639. +#endif
  640. int fs_fd=-1; // fd to the root-dir of the fs we're checking (only w/lfag == 1)
  641. flags = 0;
  642. @@ -203,7 +212,9 @@
  643. canWrite = 0;
  644. unraw = NULL;
  645. mntonname = NULL;
  646. -
  647. +#if LINUX
  648. + // FIXME
  649. +#else
  650. if (lflag) {
  651. result = getmntinfo(&fsinfo, MNT_NOWAIT);
  652. @@ -233,7 +244,7 @@
  653. }
  654. }
  655. }
  656. -
  657. +#endif
  658. if (debug && preen)
  659. pwarn("starting\n");
  660. @@ -306,6 +317,9 @@
  661. }
  662. }
  663. } else {
  664. +#if LINUX
  665. + // FIXME
  666. +#else
  667. struct statfs stfs_buf;
  668. /*
  669. * Check to see if root is mounted read-write.
  670. @@ -315,18 +329,24 @@
  671. else
  672. flags = 0;
  673. ckfini(flags & MNT_RDONLY);
  674. +#endif
  675. }
  676. /* XXX free any allocated memory here */
  677. if (hotroot && fsmodified) {
  678. +#if !LINUX
  679. struct hfs_mount_args args;
  680. +#endif
  681. /*
  682. * We modified the root. Do a mount update on
  683. * it, unless it is read-write, so we can continue.
  684. */
  685. if (!preen)
  686. printf("\n***** FILE SYSTEM WAS MODIFIED *****\n");
  687. +#if LINUX
  688. + // FIXME
  689. +#else
  690. if (flags & MNT_RDONLY) {
  691. bzero(&args, sizeof(args));
  692. flags |= MNT_UPDATE | MNT_RELOAD;
  693. @@ -335,6 +355,7 @@
  694. goto ExitThisRoutine;
  695. }
  696. }
  697. +#endif
  698. if (!preen)
  699. printf("\n***** REBOOT NOW *****\n");
  700. sync();
  701. @@ -380,11 +401,13 @@
  702. printf("Can't stat %s: %s\n", dev, strerror(errno));
  703. return (0);
  704. }
  705. +#if !LINUX
  706. if ((statb.st_mode & S_IFMT) != S_IFCHR) {
  707. pfatal("%s is not a character device", dev);
  708. if (reply("CONTINUE") == 0)
  709. return (0);
  710. }
  711. +#endif
  712. if ((fsreadfd = open(dev, O_RDONLY)) < 0) {
  713. printf("Can't open %s: %s\n", dev, strerror(errno));
  714. return (0);
  715. @@ -407,10 +430,14 @@
  716. printf("\n");
  717. /* Get device block size to initialize cache */
  718. +#if LINUX
  719. + devBlockSize = 512;
  720. +#else
  721. if (ioctl(fsreadfd, DKIOCGETBLOCKSIZE, &devBlockSize) < 0) {
  722. pfatal ("Can't get device block size\n");
  723. return (0);
  724. }
  725. +#endif
  726. /* Initialize the cache */
  727. if (CacheInit (&fscache, fsreadfd, fswritefd, devBlockSize,
  728. CACHE_IOSIZE, CACHE_BLOCKS, CACHE_HASHSIZE) != EOK) {
  729. @@ -431,11 +458,15 @@
  730. static void getWriteAccess( char *dev, int *blockDevice_fdPtr, int *canWritePtr )
  731. {
  732. +#if !LINUX
  733. int i;
  734. int myMountsCount;
  735. +#endif
  736. void * myPtr;
  737. char * myCharPtr;
  738. +#if !LINUX
  739. struct statfs * myBufPtr;
  740. +#endif
  741. void * myNamePtr;
  742. myPtr = NULL;
  743. @@ -456,18 +487,19 @@
  744. *canWritePtr = 1;
  745. goto ExitThisRoutine;
  746. }
  747. -
  748. // get count of mounts then get the info for each
  749. +#if LINUX
  750. + // FIXME
  751. +#else
  752. myMountsCount = getfsstat( NULL, 0, MNT_NOWAIT );
  753. if ( myMountsCount < 0 )
  754. goto ExitThisRoutine;
  755. -
  756. myPtr = (void *) malloc( sizeof(struct statfs) * myMountsCount );
  757. if ( myPtr == NULL )
  758. goto ExitThisRoutine;
  759. myMountsCount = getfsstat( myPtr,
  760. - (sizeof(struct statfs) * myMountsCount),
  761. - MNT_NOWAIT );
  762. + (sizeof(struct statfs) * myMountsCount),
  763. + MNT_NOWAIT );
  764. if ( myMountsCount < 0 )
  765. goto ExitThisRoutine;
  766. @@ -481,8 +513,8 @@
  767. }
  768. myBufPtr++;
  769. }
  770. +#endif
  771. *canWritePtr = 1; // single user will get us here, f_mntfromname is not /dev/diskXXXX
  772. -
  773. ExitThisRoutine:
  774. if ( myPtr != NULL )
  775. free( myPtr );
  776. @@ -504,7 +536,7 @@
  777. (void) fprintf(stderr, " l = live fsck (lock down and test-only)\n");
  778. (void) fprintf(stderr, " m arg = octal mode used when creating lost+found directory \n");
  779. (void) fprintf(stderr, " n = assume a no response \n");
  780. - (void) fprintf(stderr, " p = just fix normal inconsistencies \n");
  781. + (void) fprintf(stderr, " p, a = just fix normal inconsistencies \n");
  782. (void) fprintf(stderr, " q = quick check returns clean, dirty, or failure \n");
  783. (void) fprintf(stderr, " r = rebuild catalog btree \n");
  784. (void) fprintf(stderr, " u = usage \n");
  785. Files diskdev_cmds-332.14/fsck_hfs.tproj/fsck_hfs.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/fsck_hfs.o differ
  786. diff -druN diskdev_cmds-332.14/fsck_hfs.tproj/Makefile.lnx diskdev_cmds-332.14-patched/fsck_hfs.tproj/Makefile.lnx
  787. --- diskdev_cmds-332.14/fsck_hfs.tproj/Makefile.lnx 1970-01-01 01:00:00.000000000 +0100
  788. +++ diskdev_cmds-332.14-patched/fsck_hfs.tproj/Makefile.lnx 2008-07-01 22:30:11.000000000 +0200
  789. @@ -0,0 +1,15 @@
  790. +CFILES = fsck_hfs.c strings.c utilities.c cache.c
  791. +OFILES = $(CFILES:.c=.o)
  792. +
  793. +all: fsck_hfs
  794. +
  795. +fsck_hfs: $(OFILES) dfalib/libdfa.a
  796. +
  797. +dfalib/libdfa.a: FORCE
  798. + $(MAKE) -C dfalib -f Makefile.lnx libdfa.a
  799. +
  800. +clean:
  801. + $(RM) fsck_hfs $(OFILES)
  802. + $(MAKE) -C dfalib -f Makefile.lnx clean
  803. +
  804. +.PHONY : FORCE clean
  805. Files diskdev_cmds-332.14/fsck_hfs.tproj/strings.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/strings.o differ
  806. diff -druN diskdev_cmds-332.14/fsck_hfs.tproj/utilities.c diskdev_cmds-332.14-patched/fsck_hfs.tproj/utilities.c
  807. --- diskdev_cmds-332.14/fsck_hfs.tproj/utilities.c 2006-02-20 22:45:15.000000000 +0100
  808. +++ diskdev_cmds-332.14-patched/fsck_hfs.tproj/utilities.c 2008-07-01 22:30:11.000000000 +0200
  809. @@ -183,12 +183,14 @@
  810. printf("Can't stat %s\n", raw);
  811. return (origname);
  812. }
  813. +#if !LINUX
  814. if ((stchar.st_mode & S_IFMT) == S_IFCHR) {
  815. return (raw);
  816. } else {
  817. printf("%s is not a character device\n", raw);
  818. return (origname);
  819. }
  820. +#endif
  821. } else if ((stblock.st_mode & S_IFMT) == S_IFCHR && !retried) {
  822. newname = unrawname(newname);
  823. retried++;
  824. @@ -214,7 +216,11 @@
  825. *dp = 0;
  826. (void)strcpy(rawbuf, name);
  827. *dp = '/';
  828. - (void)strcat(rawbuf, "/r");
  829. +#if LINUX
  830. + (void)strcat(rawbuf, "/");
  831. +#else
  832. + (void)strcat(rawbuf,"/r");
  833. +#endif
  834. (void)strcat(rawbuf, &dp[1]);
  835. return (rawbuf);
  836. Files diskdev_cmds-332.14/fsck_hfs.tproj/utilities.o and diskdev_cmds-332.14-patched/fsck_hfs.tproj/utilities.o differ
  837. diff -druN diskdev_cmds-332.14/include/bitstring.h diskdev_cmds-332.14-patched/include/bitstring.h
  838. --- diskdev_cmds-332.14/include/bitstring.h 1970-01-01 01:00:00.000000000 +0100
  839. +++ diskdev_cmds-332.14-patched/include/bitstring.h 2008-07-01 22:30:11.000000000 +0200
  840. @@ -0,0 +1,164 @@
  841. +/*
  842. + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
  843. + *
  844. + * @APPLE_LICENSE_HEADER_START@
  845. + *
  846. + * The contents of this file constitute Original Code as defined in and
  847. + * are subject to the Apple Public Source License Version 1.1 (the
  848. + * "License"). You may not use this file except in compliance with the
  849. + * License. Please obtain a copy of the License at
  850. + * http://www.apple.com/publicsource and read it before using this file.
  851. + *
  852. + * This Original Code and all software distributed under the License are
  853. + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  854. + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  855. + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
  856. + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
  857. + * License for the specific language governing rights and limitations
  858. + * under the License.
  859. + *
  860. + * @APPLE_LICENSE_HEADER_END@
  861. + */
  862. +/*
  863. + * Copyright (c) 1989, 1993
  864. + * The Regents of the University of California. All rights reserved.
  865. + *
  866. + * This code is derived from software contributed to Berkeley by
  867. + * Paul Vixie.
  868. + *
  869. + * Redistribution and use in source and binary forms, with or without
  870. + * modification, are permitted provided that the following conditions
  871. + * are met:
  872. + * 1. Redistributions of source code must retain the above copyright
  873. + * notice, this list of conditions and the following disclaimer.
  874. + * 2. Redistributions in binary form must reproduce the above copyright
  875. + * notice, this list of conditions and the following disclaimer in the
  876. + * documentation and/or other materials provided with the distribution.
  877. + * 3. All advertising materials mentioning features or use of this software
  878. + * must display the following acknowledgement:
  879. + * This product includes software developed by the University of
  880. + * California, Berkeley and its contributors.
  881. + * 4. Neither the name of the University nor the names of its contributors
  882. + * may be used to endorse or promote products derived from this software
  883. + * without specific prior written permission.
  884. + *
  885. + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  886. + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  887. + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  888. + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  889. + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  890. + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  891. + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  892. + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  893. + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  894. + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  895. + * SUCH DAMAGE.
  896. + *
  897. + * @(#)bitstring.h 8.1 (Berkeley) 7/19/93
  898. + */
  899. +
  900. +#ifndef _BITSTRING_H_
  901. +#define _BITSTRING_H_
  902. +
  903. +typedef unsigned char bitstr_t;
  904. +
  905. +/* internal macros */
  906. + /* byte of the bitstring bit is in */
  907. +#define _bit_byte(bit) \
  908. + ((bit) >> 3)
  909. +
  910. + /* mask for the bit within its byte */
  911. +#define _bit_mask(bit) \
  912. + (1 << ((bit)&0x7))
  913. +
  914. +/* external macros */
  915. + /* bytes in a bitstring of nbits bits */
  916. +#define bitstr_size(nbits) \
  917. + ((((nbits) - 1) >> 3) + 1)
  918. +
  919. + /* allocate a bitstring */
  920. +#define bit_alloc(nbits) \
  921. + (bitstr_t *)calloc(1, \
  922. + (unsigned int)bitstr_size(nbits) * sizeof(bitstr_t))
  923. +
  924. + /* allocate a bitstring on the stack */
  925. +#define bit_decl(name, nbits) \
  926. + (name)[bitstr_size(nbits)]
  927. +
  928. + /* is bit N of bitstring name set? */
  929. +#define bit_test(name, bit) \
  930. + ((name)[_bit_byte(bit)] & _bit_mask(bit))
  931. +
  932. + /* set bit N of bitstring name */
  933. +#define bit_set(name, bit) \
  934. + (name)[_bit_byte(bit)] |= _bit_mask(bit)
  935. +
  936. + /* clear bit N of bitstring name */
  937. +#define bit_clear(name, bit) \
  938. + (name)[_bit_byte(bit)] &= ~_bit_mask(bit)
  939. +
  940. + /* clear bits start ... stop in bitstring */
  941. +#define bit_nclear(name, start, stop) { \
  942. + register bitstr_t *_name = name; \
  943. + register int _start = start, _stop = stop; \
  944. + register int _startbyte = _bit_byte(_start); \
  945. + register int _stopbyte = _bit_byte(_stop); \
  946. + if (_startbyte == _stopbyte) { \
  947. + _name[_startbyte] &= ((0xff >> (8 - (_start&0x7))) | \
  948. + (0xff << ((_stop&0x7) + 1))); \
  949. + } else { \
  950. + _name[_startbyte] &= 0xff >> (8 - (_start&0x7)); \
  951. + while (++_startbyte < _stopbyte) \
  952. + _name[_startbyte] = 0; \
  953. + _name[_stopbyte] &= 0xff << ((_stop&0x7) + 1); \
  954. + } \
  955. +}
  956. +
  957. + /* set bits start ... stop in bitstring */
  958. +#define bit_nset(name, start, stop) { \
  959. + register bitstr_t *_name = name; \
  960. + register int _start = start, _stop = stop; \
  961. + register int _startbyte = _bit_byte(_start); \
  962. + register int _stopbyte = _bit_byte(_stop); \
  963. + if (_startbyte == _stopbyte) { \
  964. + _name[_startbyte] |= ((0xff << (_start&0x7)) & \
  965. + (0xff >> (7 - (_stop&0x7)))); \
  966. + } else { \
  967. + _name[_startbyte] |= 0xff << ((_start)&0x7); \
  968. + while (++_startbyte < _stopbyte) \
  969. + _name[_startbyte] = 0xff; \
  970. + _name[_stopbyte] |= 0xff >> (7 - (_stop&0x7)); \
  971. + } \
  972. +}
  973. +
  974. + /* find first bit clear in name */
  975. +#define bit_ffc(name, nbits, value) { \
  976. + register bitstr_t *_name = name; \
  977. + register int _byte, _nbits = nbits; \
  978. + register int _stopbyte = _bit_byte(_nbits), _value = -1; \
  979. + for (_byte = 0; _byte <= _stopbyte; ++_byte) \
  980. + if (_name[_byte] != 0xff) { \
  981. + _value = _byte << 3; \
  982. + for (_stopbyte = _name[_byte]; (_stopbyte&0x1); \
  983. + ++_value, _stopbyte >>= 1); \
  984. + break; \
  985. + } \
  986. + *(value) = _value; \
  987. +}
  988. +
  989. + /* find first bit set in name */
  990. +#define bit_ffs(name, nbits, value) { \
  991. + register bitstr_t *_name = name; \
  992. + register int _byte, _nbits = nbits; \
  993. + register int _stopbyte = _bit_byte(_nbits), _value = -1; \
  994. + for (_byte = 0; _byte <= _stopbyte; ++_byte) \
  995. + if (_name[_byte]) { \
  996. + _value = _byte << 3; \
  997. + for (_stopbyte = _name[_byte]; !(_stopbyte&0x1); \
  998. + ++_value, _stopbyte >>= 1); \
  999. + break; \
  1000. + } \
  1001. + *(value) = _value; \
  1002. +}
  1003. +
  1004. +#endif /* !_BITSTRING_H_ */
  1005. diff -druN diskdev_cmds-332.14/include/hfs/hfs_format.h diskdev_cmds-332.14-patched/include/hfs/hfs_format.h
  1006. --- diskdev_cmds-332.14/include/hfs/hfs_format.h 1970-01-01 01:00:00.000000000 +0100
  1007. +++ diskdev_cmds-332.14-patched/include/hfs/hfs_format.h 2008-07-01 22:30:11.000000000 +0200
  1008. @@ -0,0 +1,689 @@
  1009. +/*
  1010. + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
  1011. + *
  1012. + * @APPLE_LICENSE_HEADER_START@
  1013. + *
  1014. + * The contents of this file constitute Original Code as defined in and
  1015. + * are subject to the Apple Public Source License Version 1.1 (the
  1016. + * "License"). You may not use this file except in compliance with the
  1017. + * License. Please obtain a copy of the License at
  1018. + * http://www.apple.com/publicsource and read it before using this file.
  1019. + *
  1020. + * This Original Code and all software distributed under the License are
  1021. + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  1022. + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  1023. + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
  1024. + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
  1025. + * License for the specific language governing rights and limitations
  1026. + * under the License.
  1027. + *
  1028. + * @APPLE_LICENSE_HEADER_END@
  1029. + */
  1030. +#ifndef __HFS_FORMAT__
  1031. +#define __HFS_FORMAT__
  1032. +
  1033. +#include "missing.h"
  1034. +
  1035. +#include <sys/appleapiopts.h>
  1036. +
  1037. +/*
  1038. + * hfs_format.c
  1039. + *
  1040. + * This file describes the on-disk format for HFS and HFS Plus volumes.
  1041. + * The HFS Plus volume format is desciibed in detail in Apple Technote 1150.
  1042. + *
  1043. + * http://developer.apple.com/technotes/tn/tn1150.html
  1044. + *
  1045. + */
  1046. +
  1047. +#ifdef __cplusplus
  1048. +extern "C" {
  1049. +#endif
  1050. +
  1051. +/* some on-disk hfs structures have 68K alignment (misaligned) */
  1052. +
  1053. +#define PACKED_S __attribute__((packed))
  1054. +
  1055. +/* Signatures used to differentiate between HFS and HFS Plus volumes */
  1056. +enum {
  1057. + kHFSSigWord = 0x4244, /* 'BD' in ASCII */
  1058. + kHFSPlusSigWord = 0x482B, /* 'H+' in ASCII */
  1059. + kHFSXSigWord = 0x4858, /* 'HX' in ASCII */
  1060. +
  1061. + kHFSPlusVersion = 0x0004, /* 'H+' volumes are version 4 only */
  1062. + kHFSXVersion = 0x0005, /* 'HX' volumes start with version 5 */
  1063. +
  1064. + kHFSPlusMountVersion = 0x31302E30, /* '10.0' for Mac OS X */
  1065. + kHFSJMountVersion = 0x4846534a, /* 'HFSJ' for journaled HFS+ on OS X */
  1066. + kFSKMountVersion = 0x46534b21 /* 'FSK!' for failed journal replay */
  1067. +}PACKED_S;
  1068. +
  1069. +
  1070. +#ifdef __APPLE_API_PRIVATE
  1071. +/*
  1072. + * Mac OS X has a special directory for linked and unlinked files (HFS Plus only).
  1073. + * This directory and its contents are never exported from the filesystem under
  1074. + * Mac OS X.
  1075. + *
  1076. + * To make this folder name sort last, it has embedded null prefix.
  1077. + * (0xC0, 0x80 in UTF-8)
  1078. + */
  1079. +#define HFSPLUSMETADATAFOLDER "\xC0\x80\xC0\x80\xC0\x80\xC0\x80HFS+ Private Data"
  1080. +
  1081. +/*
  1082. + * Files in the HFS Private Data folder have one of the following prefixes
  1083. + * followed by a decimal number (no leading zeros). For indirect nodes this
  1084. + * number is a 32 bit random number. For unlinked (deleted) files that are
  1085. + * still open, the number is the file ID for that file.
  1086. + *
  1087. + * e.g. iNode7182000 and temp3296
  1088. + */
  1089. +#define HFS_INODE_PREFIX "iNode"
  1090. +#define HFS_DELETE_PREFIX "temp"
  1091. +
  1092. +#endif /* __APPLE_API_PRIVATE */
  1093. +
  1094. +/*
  1095. + * Indirect link files (hard links) have the following type/creator.
  1096. + */
  1097. +enum {
  1098. + kHardLinkFileType = 0x686C6E6B, /* 'hlnk' */
  1099. + kHFSPlusCreator = 0x6866732B /* 'hfs+' */
  1100. +}PACKED_S;
  1101. +
  1102. +
  1103. +#ifndef _HFSUNISTR255_DEFINED_
  1104. +#define _HFSUNISTR255_DEFINED_
  1105. +/* Unicode strings are used for HFS Plus file and folder names */
  1106. +struct HFSUniStr255 {
  1107. + u_int16_t length; /* number of unicode characters */
  1108. + u_int16_t unicode[255]; /* unicode characters */
  1109. +} PACKED_S;
  1110. +typedef struct HFSUniStr255 HFSUniStr255;
  1111. +typedef const HFSUniStr255 *ConstHFSUniStr255Param;
  1112. +#endif /* _HFSUNISTR255_DEFINED_ */
  1113. +
  1114. +enum {
  1115. + kHFSMaxVolumeNameChars = 27,
  1116. + kHFSMaxFileNameChars = 31,
  1117. + kHFSPlusMaxFileNameChars = 255
  1118. +}PACKED_S;
  1119. +
  1120. +
  1121. +/* Extent overflow file data structures */
  1122. +
  1123. +/* HFS Extent key */
  1124. +struct HFSExtentKey {
  1125. + u_int8_t keyLength; /* length of key, excluding this field */
  1126. + u_int8_t forkType; /* 0 = data fork, FF = resource fork */
  1127. + u_int32_t fileID; /* file ID */
  1128. + u_int16_t startBlock; /* first file allocation block number in this extent */
  1129. +}PACKED_S;
  1130. +typedef struct HFSExtentKey HFSExtentKey;
  1131. +
  1132. +/* HFS Plus Extent key */
  1133. +struct HFSPlusExtentKey {
  1134. + u_int16_t keyLength; /* length of key, excluding this field */
  1135. + u_int8_t forkType; /* 0 = data fork, FF = resource fork */
  1136. + u_int8_t pad; /* make the other fields align on 32-bit boundary */
  1137. + u_int32_t fileID; /* file ID */
  1138. + u_int32_t startBlock; /* first file allocation block number in this extent */
  1139. +}PACKED_S;
  1140. +typedef struct HFSPlusExtentKey HFSPlusExtentKey;
  1141. +
  1142. +/* Number of extent descriptors per extent record */
  1143. +enum {
  1144. + kHFSExtentDensity = 3,
  1145. + kHFSPlusExtentDensity = 8
  1146. +}PACKED_S;
  1147. +
  1148. +/* HFS extent descriptor */
  1149. +struct HFSExtentDescriptor {
  1150. + u_int16_t startBlock; /* first allocation block */
  1151. + u_int16_t blockCount; /* number of allocation blocks */
  1152. +}PACKED_S;
  1153. +typedef struct HFSExtentDescriptor HFSExtentDescriptor;
  1154. +
  1155. +/* HFS Plus extent descriptor */
  1156. +struct HFSPlusExtentDescriptor {
  1157. + u_int32_t startBlock; /* first allocation block */
  1158. + u_int32_t blockCount; /* number of allocation blocks */
  1159. +}PACKED_S;
  1160. +typedef struct HFSPlusExtentDescriptor HFSPlusExtentDescriptor;
  1161. +
  1162. +/* HFS extent record */
  1163. +typedef HFSExtentDescriptor HFSExtentRecord[3];
  1164. +
  1165. +/* HFS Plus extent record */
  1166. +typedef HFSPlusExtentDescriptor HFSPlusExtentRecord[8];
  1167. +
  1168. +
  1169. +/* Finder information */
  1170. +struct FndrFileInfo {
  1171. + u_int32_t fdType; /* file type */
  1172. + u_int32_t fdCreator; /* file creator */
  1173. + u_int16_t fdFlags; /* Finder flags */
  1174. + struct {
  1175. + int16_t v; /* file's location */
  1176. + int16_t h;
  1177. + } PACKED_S fdLocation;
  1178. + int16_t opaque;
  1179. +}PACKED_S;
  1180. +typedef struct FndrFileInfo FndrFileInfo;
  1181. +
  1182. +struct FndrDirInfo {
  1183. + struct { /* folder's window rectangle */
  1184. + int16_t top;
  1185. + int16_t left;
  1186. + int16_t bottom;
  1187. + int16_t right;
  1188. + }PACKED_S frRect;
  1189. + unsigned short frFlags; /* Finder flags */
  1190. + struct {
  1191. + u_int16_t v; /* folder's location */
  1192. + u_int16_t h;
  1193. + }PACKED_S frLocation;
  1194. + int16_t opaque;
  1195. +}PACKED_S;
  1196. +typedef struct FndrDirInfo FndrDirInfo;
  1197. +
  1198. +struct FndrOpaqueInfo {
  1199. + int8_t opaque[16];
  1200. +}PACKED_S;
  1201. +typedef struct FndrOpaqueInfo FndrOpaqueInfo;
  1202. +
  1203. +
  1204. +/* HFS Plus Fork data info - 80 bytes */
  1205. +struct HFSPlusForkData {
  1206. + u_int64_t logicalSize; /* fork's logical size in bytes */
  1207. + u_int32_t clumpSize; /* fork's clump size in bytes */
  1208. + u_int32_t totalBlocks; /* total blocks used by this fork */
  1209. + HFSPlusExtentRecord extents; /* initial set of extents */
  1210. +}PACKED_S;
  1211. +typedef struct HFSPlusForkData HFSPlusForkData;
  1212. +
  1213. +
  1214. +/* Mac OS X has 16 bytes worth of "BSD" info.
  1215. + *
  1216. + * Note: Mac OS 9 implementations and applications
  1217. + * should preserve, but not change, this information.
  1218. + */
  1219. +struct HFSPlusBSDInfo {
  1220. + u_int32_t ownerID; /* user or group ID of file/folder owner */
  1221. + u_int32_t groupID; /* additional user of group ID */
  1222. + u_int8_t adminFlags; /* super-user changeable flags */
  1223. + u_int8_t ownerFlags; /* owner changeable flags */
  1224. + u_int16_t fileMode; /* file type and permission bits */
  1225. + union {
  1226. + u_int32_t iNodeNum; /* indirect node number (hard links only) */
  1227. + u_int32_t linkCount; /* links that refer to this indirect node */
  1228. + u_int32_t rawDevice; /* special file device (FBLK and FCHR only) */
  1229. + }PACKED_S special;
  1230. +}PACKED_S;
  1231. +typedef struct HFSPlusBSDInfo HFSPlusBSDInfo;
  1232. +
  1233. +
  1234. +/* Catalog file data structures */
  1235. +
  1236. +enum {
  1237. + kHFSRootParentID = 1, /* Parent ID of the root folder */
  1238. + kHFSRootFolderID = 2, /* Folder ID of the root folder */
  1239. + kHFSExtentsFileID = 3, /* File ID of the extents file */
  1240. + kHFSCatalogFileID = 4, /* File ID of the catalog file */
  1241. + kHFSBadBlockFileID = 5, /* File ID of the bad allocation block file */
  1242. + kHFSAllocationFileID = 6, /* File ID of the allocation file (HFS Plus only) */
  1243. + kHFSStartupFileID = 7, /* File ID of the startup file (HFS Plus only) */
  1244. + kHFSAttributesFileID = 8, /* File ID of the attribute file (HFS Plus only) */
  1245. + kHFSRepairCatalogFileID = 14, /* Used when rebuilding Catalog B-tree */
  1246. + kHFSBogusExtentFileID = 15, /* Used for exchanging extents in extents file */
  1247. + kHFSFirstUserCatalogNodeID = 16
  1248. +}PACKED_S;
  1249. +
  1250. +/* HFS catalog key */
  1251. +struct HFSCatalogKey {
  1252. + u_int8_t keyLength; /* key length (in bytes) */
  1253. + u_int8_t reserved; /* reserved (set to zero) */
  1254. + u_int32_t parentID; /* parent folder ID */
  1255. + u_int8_t nodeName[kHFSMaxFileNameChars + 1]; /* catalog node name */
  1256. +}PACKED_S;
  1257. +typedef struct HFSCatalogKey HFSCatalogKey;
  1258. +
  1259. +/* HFS Plus catalog key */
  1260. +struct HFSPlusCatalogKey {
  1261. + u_int16_t keyLength; /* key length (in bytes) */
  1262. + u_int32_t parentID; /* parent folder ID */
  1263. + HFSUniStr255 nodeName; /* catalog node name */
  1264. +}PACKED_S;
  1265. +typedef struct HFSPlusCatalogKey HFSPlusCatalogKey;
  1266. +
  1267. +/* Catalog record types */
  1268. +enum {
  1269. + /* HFS Catalog Records */
  1270. + kHFSFolderRecord = 0x0100, /* Folder record */
  1271. + kHFSFileRecord = 0x0200, /* File record */
  1272. + kHFSFolderThreadRecord = 0x0300, /* Folder thread record */
  1273. + kHFSFileThreadRecord = 0x0400, /* File thread record */
  1274. +
  1275. + /* HFS Plus Catalog Records */
  1276. + kHFSPlusFolderRecord = 1, /* Folder record */
  1277. + kHFSPlusFileRecord = 2, /* File record */
  1278. + kHFSPlusFolderThreadRecord = 3, /* Folder thread record */
  1279. + kHFSPlusFileThreadRecord = 4 /* File thread record */
  1280. +}PACKED_S;
  1281. +
  1282. +
  1283. +/* Catalog file record flags */
  1284. +enum {
  1285. + kHFSFileLockedBit = 0x0000, /* file is locked and cannot be written to */
  1286. + kHFSFileLockedMask = 0x0001,
  1287. +
  1288. + kHFSThreadExistsBit = 0x0001, /* a file thread record exists for this file */
  1289. + kHFSThreadExistsMask = 0x0002,
  1290. +
  1291. + kHFSHasAttributesBit = 0x0002, /* object has extended attributes */
  1292. + kHFSHasAttributesMask = 0x0004,
  1293. +
  1294. + kHFSHasSecurityBit = 0x0003, /* object has security data (ACLs) */
  1295. + kHFSHasSecurityMask = 0x0008
  1296. +}PACKED_S;
  1297. +
  1298. +
  1299. +/* HFS catalog folder record - 70 bytes */
  1300. +struct HFSCatalogFolder {
  1301. + int16_t recordType; /* == kHFSFolderRecord */
  1302. + u_int16_t flags; /* folder flags */
  1303. + u_int16_t valence; /* folder valence */
  1304. + u_int32_t folderID; /* folder ID */
  1305. + u_int32_t createDate; /* date and time of creation */
  1306. + u_int32_t modifyDate; /*…