summaryrefslogtreecommitdiff
path: root/user/diskdev_cmds/musl.patch
blob: f5977a20b67f0d9c175b41e9d0196647f479bba3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
--- diskdev_cmds-332.14/newfs_hfs.tproj/newfs_hfs.c.old	2017-01-22 02:17:05.677956396 +0100
+++ diskdev_cmds-332.14/newfs_hfs.tproj/newfs_hfs.c	2017-01-22 02:37:37.415539705 +0100
@@ -39,6 +39,7 @@
 #include <sys/param.h>
 #include <sys/stat.h>
 #if LINUX
+#include <sys/cdefs.h>
 #include <time.h>
 #endif
 
--- diskdev_cmds-332.14/newfs_hfs.tproj/makehfs.c.old	2017-01-22 02:17:05.677956396 +0100
+++ diskdev_cmds-332.14/newfs_hfs.tproj/makehfs.c	2017-01-22 02:36:51.065627226 +0100
@@ -32,14 +32,15 @@
 #include <sys/types.h>
 #include <sys/time.h>
 #if LINUX
+#include <sys/cdefs.h>
 #include <time.h>
 #include "missing.h"
 #endif
 #include <sys/errno.h>
 #include <sys/stat.h>
-#include <sys/sysctl.h>
 #if !LINUX
 #include <sys/vmmeter.h>
+#include <sys/sysctl.h>
 #endif
 
 #include <err.h>
--- diskdev_cmds-332.14/fsck_hfs.tproj/fsck_hfs.h.old	2006-02-20 22:45:15.000000000 +0100
+++ diskdev_cmds-332.14/fsck_hfs.tproj/fsck_hfs.h	2017-01-22 02:28:49.256503270 +0100
@@ -22,6 +22,7 @@
  * @APPLE_LICENSE_HEADER_END@
  */
 
+#include <sys/cdefs.h>
 #include "cache.h"
 
 
--- diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/CatalogCheck.c.old	2006-02-20 22:45:15.000000000 +0100
+++ diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/CatalogCheck.c	2017-01-22 02:32:45.319415260 +0100
@@ -64,7 +64,7 @@
 static void CheckBSDInfo(const HFSPlusCatalogKey * key, const HFSPlusBSDInfo * bsdInfo, int isdir);
 static int  CheckCatalogName(u_int16_t charCount, const u_int16_t *uniChars,
                              u_int32_t parentID, Boolean thread);
-static int  CheckCatalogName_HFS(u_int16_t charCount, const u_char *filename,
+static int  CheckCatalogName_HFS(u_int16_t charCount, const UInt8 *filename,
                                  u_int32_t parentID, Boolean thread);
 
 static int  RecordBadAllocation(UInt32 parID, unsigned char * filename, UInt32 forkType, UInt32 oldBlkCnt, UInt32 newBlkCnt);
@@ -951,9 +951,9 @@
  * if repairable then log the error and create a repair order
  */
 static int
-CheckCatalogName_HFS(u_int16_t charCount, const u_char *filename, u_int32_t parentID, Boolean thread)
+CheckCatalogName_HFS(u_int16_t charCount, const UInt8 *filename, u_int32_t parentID, Boolean thread)
 {
-	u_char *			myPtr;
+	UInt8 *			myPtr;
 	RepairOrderPtr 		roPtr;
 	int					myLength;
     CatalogName			newName;
@@ -997,7 +997,7 @@
             if ( roPtr == NULL ) 
                 return( noErr );
  
-            myPtr = (u_char *)&roPtr->name[0];
+            myPtr = (UInt8 *)&roPtr->name[0];
             *myPtr++ = charCount; // copy in length of old name and bump past it
             CopyMemory( filename, myPtr, charCount );
             myPtr += charCount; // bump past old name
@@ -1030,15 +1030,15 @@
                 Boolean isSingleDotName,
              	Boolean isHFSPlus )
 {
-    u_char				newChar;
+    UInt8				newChar;
 	OSErr 				result;
 	int					nameLen;
 	UInt16				recSize;
 	SFCB *				fcbPtr;
-    u_char *			myPtr;
+    UInt8 *			myPtr;
 	CatalogRecord		record;
     CatalogKey			catKey;
-    u_char				dotName[] = {'d', 'o', 't', 'd', 'o', 't', 0x0d, 0x00};
+    UInt8				dotName[] = {'d', 'o', 't', 'd', 'o', 't', 0x0d, 0x00};
 
   	fcbPtr = GPtr->calculatedCatalogFCB;
  
--- diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SRepair.c.old	2017-01-22 02:17:05.674623072 +0100
+++ diskdev_cmds-332.14/fsck_hfs.tproj/dfalib/SRepair.c	2017-01-22 02:32:58.596057772 +0100
@@ -92,11 +92,11 @@
 
 /* Functions to copy disk blocks or data buffer to disk */
 static 	OSErr 	CopyDiskBlocks(SGlobPtr GPtr, const UInt32 startAllocationBlock, const UInt32 blockCount, const UInt32 newStartAllocationBlock );
-static 	OSErr 	WriteDiskBlocks(SGlobPtr GPtr, UInt32 startBlock, UInt32 blockCount, u_char *buffer, int buflen);
+static 	OSErr 	WriteDiskBlocks(SGlobPtr GPtr, UInt32 startBlock, UInt32 blockCount, UInt8 *buffer, int buflen);
 
 /* Functions to create file and directory by name */
-static 	OSErr 	CreateFileByName(SGlobPtr GPtr, UInt32 parentID, UInt16 fileType, u_char *fileName, unsigned int filenameLen, u_char *data, unsigned int dataLen);
-static 	UInt32 	CreateDirByName(SGlob *GPtr , const u_char *dirName, const UInt32 parentID);
+static 	OSErr 	CreateFileByName(SGlobPtr GPtr, UInt32 parentID, UInt16 fileType, UInt8 *fileName, unsigned int filenameLen, UInt8 *data, unsigned int dataLen);
+static 	UInt32 	CreateDirByName(SGlob *GPtr , const UInt8 *dirName, const UInt32 parentID);
 
 static 	int		BuildFolderRec( u_int16_t theMode, UInt32 theObjID, Boolean isHFSPlus, CatalogRecord * theRecPtr );
 static 	int		BuildThreadRec( CatalogKey * theKeyPtr, CatalogRecord * theRecPtr, Boolean isHFSPlus, Boolean isDirectory );
@@ -1222,7 +1222,7 @@
     else
     {
         int					myLength;
-        u_char *			myPtr = (u_char *) oldNamePtr;
+        UInt8 *			myPtr = (UInt8 *) oldNamePtr;
         myLength = *myPtr; // get length of old name
         myPtr += (1 + myLength);  // bump past length of old name and old name
         newNamePtr = (CatalogName *) myPtr;
@@ -2651,7 +2651,7 @@
 	}
 
 	/* Lookup or create damagedFiles directory */
-	damagedDirID = CreateDirByName(GPtr, (u_char *)"DamagedFiles", kHFSRootFolderID);
+	damagedDirID = CreateDirByName(GPtr, (UInt8 *)"DamagedFiles", kHFSRootFolderID);
 	if (damagedDirID == 0) {
 		status |= S_SYMCREATE;
 #if DEBUG_OVERLAP
@@ -3012,8 +3012,8 @@
 	}
 
 	/* Create new file */
-	err = CreateFileByName (GPtr, targetParentID, fileType, (u_char *)filename, 
-							filenamelen, (u_char *)data, datalen);
+	err = CreateFileByName (GPtr, targetParentID, fileType, (UInt8 *)filename, 
+							filenamelen, (UInt8 *)data, datalen);
 	/* Mask error if file already exists */
 	if (err == EEXIST) {
 		err = noErr;
@@ -3544,7 +3544,7 @@
 	struct fsPathString *listHeadPtr = NULL;
 	struct fsPathString *listTailPtr = NULL;
 	struct fsPathString *curPtr = NULL;
-	u_char *filename = NULL;
+	UInt8 *filename = NULL;
 	size_t namelen;
 
 	if (!fullPath && !fileName) {
@@ -3832,13 +3832,13 @@
  * 	returns zero on success, non-zero on failure.
  *		memFullErr - Not enough memory
  */
-OSErr WriteDiskBlocks(SGlobPtr GPtr, UInt32 startBlock, UInt32 blockCount, u_char *buffer, int bufLen) 
+OSErr WriteDiskBlocks(SGlobPtr GPtr, UInt32 startBlock, UInt32 blockCount, UInt8 *buffer, int bufLen) 
 {
 	OSErr err = noErr;
 	int i;
 	SVCB *vcb;
 	int drive;
-	u_char *dataBuffer;
+	UInt8 *dataBuffer;
 	UInt32 sectorsPerBlock;
 	UInt32 sectorsInBuffer;
 	UInt32 ioReqCount;
@@ -3959,7 +3959,7 @@
 		if ( mtp->thread.parentID == 0 ) {
 			char 	myString[32];
 			if ( lostAndFoundDirID == 0 )
-				lostAndFoundDirID = CreateDirByName( GPtr , (u_char *)"lost+found", kHFSRootFolderID);
+				lostAndFoundDirID = CreateDirByName( GPtr , (UInt8 *)"lost+found", kHFSRootFolderID);
 			if ( lostAndFoundDirID == 0 ) {
 				if ( GPtr->logLevel >= kDebugLog )
 					printf( "\tCould not create lost+found directory \n" );
@@ -4144,7 +4144,7 @@
  *		memFullErr - Not enough memory
  *		paramErr - Invalid paramter
  */
-OSErr CreateFileByName(SGlobPtr GPtr, UInt32 parentID, UInt16 fileType, u_char *fileName, unsigned int filenameLen, u_char *data, unsigned int dataLen)
+OSErr CreateFileByName(SGlobPtr GPtr, UInt32 parentID, UInt16 fileType, UInt8 *fileName, unsigned int filenameLen, UInt8 *data, unsigned int dataLen)
 {	
 	OSErr err = noErr;
 	Boolean isHFSPlus;
@@ -4378,7 +4378,7 @@
  * 	on failure, zero.
  *  
  */
-UInt32 CreateDirByName(SGlob *GPtr , const u_char *dirName, const UInt32 parentID)
+UInt32 CreateDirByName(SGlob *GPtr , const UInt8 *dirName, const UInt32 parentID)
 {
 	Boolean				isHFSPlus;
 	UInt16				recSize;