Package: hfsprogs / 332.25-8

92-fix-types.patch Patch series | download
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
--- a/fsck_hfs.tproj/cache.c
+++ b/fsck_hfs.tproj/cache.c
@@ -961,20 +961,21 @@
  */
 int CacheRawRead (Cache_t *cache, uint64_t off, uint32_t len, void *buf)
 {
-	uint64_t	result;
+	off_t	result1;
+	ssize_t result2;
 		
 	/* Both offset and length must be multiples of the device block size */
 	if (off % cache->DevBlockSize) return (EINVAL);
 	if (len % cache->DevBlockSize) return (EINVAL);
 	
 	/* Seek to the position */
-	result = lseek (cache->FD_R, off, SEEK_SET);
-	if (result < 0) return (errno);
-	if (result != off) return (ENXIO);
+	result1 = lseek(cache->FD_R, off, SEEK_SET);
+	if (result1 < 0) return (errno);
+	if (result1 != off) return (ENXIO);
 	/* Read into the buffer */
-	result = read (cache->FD_R, buf, len);
-	if (result < 0) return (errno);
-	if (result == 0) return (ENXIO);
+	result2 = read(cache->FD_R, buf, len);
+	if (result2 < 0) return (errno);
+	if (result2 == 0) return (ENXIO);
 
 	/* Update counters */
 	cache->DiskRead++;
@@ -989,21 +990,22 @@
  */
 int CacheRawWrite (Cache_t *cache, uint64_t off, uint32_t len, void *buf)
 {
-	uint64_t	result;
+	off_t	result1;
+	ssize_t result2;
 	
 	/* Both offset and length must be multiples of the device block size */
 	if (off % cache->DevBlockSize) return (EINVAL);
 	if (len % cache->DevBlockSize) return (EINVAL);
 	
 	/* Seek to the position */
-	result = lseek (cache->FD_W, off, SEEK_SET);
-	if (result < 0) return (errno);
-	if (result != off) return (ENXIO);
+	result1 = lseek (cache->FD_W, off, SEEK_SET);
+	if (result1 < 0) return (errno);
+	if (result1 != off) return (ENXIO);
 	
 	/* Write into the buffer */
-	result = write (cache->FD_W, buf, len);
-	if (result < 0) return (errno);
-	if (result == 0) return (ENXIO);
+	result2 = write (cache->FD_W, buf, len);
+	if (result2 < 0) return (errno);
+	if (result2 == 0) return (ENXIO);
 	
 	/* Update counters */
 	cache->DiskWrite++;