1 From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
2 Date: Thu, 24 Oct 2013 01:11:22 -0200
6 fsck_hfs.tproj/cache.c | 30 ++++++++++++++++--------------
7 1 file changed, 16 insertions(+), 14 deletions(-)
9 diff --git a/fsck_hfs.tproj/cache.c b/fsck_hfs.tproj/cache.c
10 index 527088a..540fa0b 100644
11 --- a/fsck_hfs.tproj/cache.c
12 +++ b/fsck_hfs.tproj/cache.c
13 @@ -961,20 +961,21 @@ int CacheLookup (Cache_t *cache, uint64_t off, Tag_t **tag)
15 int CacheRawRead (Cache_t *cache, uint64_t off, uint32_t len, void *buf)
21 /* Both offset and length must be multiples of the device block size */
22 if (off % cache->DevBlockSize) return (EINVAL);
23 if (len % cache->DevBlockSize) return (EINVAL);
25 /* Seek to the position */
26 - result = lseek (cache->FD_R, off, SEEK_SET);
27 - if (result < 0) return (errno);
28 - if (result != off) return (ENXIO);
29 + result1 = lseek(cache->FD_R, off, SEEK_SET);
30 + if (result1 < 0) return (errno);
31 + if (result1 != off) return (ENXIO);
32 /* Read into the buffer */
33 - result = read (cache->FD_R, buf, len);
34 - if (result < 0) return (errno);
35 - if (result == 0) return (ENXIO);
36 + result2 = read(cache->FD_R, buf, len);
37 + if (result2 < 0) return (errno);
38 + if (result2 == 0) return (ENXIO);
42 @@ -989,21 +990,22 @@ int CacheRawRead (Cache_t *cache, uint64_t off, uint32_t len, void *buf)
44 int CacheRawWrite (Cache_t *cache, uint64_t off, uint32_t len, void *buf)
50 /* Both offset and length must be multiples of the device block size */
51 if (off % cache->DevBlockSize) return (EINVAL);
52 if (len % cache->DevBlockSize) return (EINVAL);
54 /* Seek to the position */
55 - result = lseek (cache->FD_W, off, SEEK_SET);
56 - if (result < 0) return (errno);
57 - if (result != off) return (ENXIO);
58 + result1 = lseek (cache->FD_W, off, SEEK_SET);
59 + if (result1 < 0) return (errno);
60 + if (result1 != off) return (ENXIO);
62 /* Write into the buffer */
63 - result = write (cache->FD_W, buf, len);
64 - if (result < 0) return (errno);
65 - if (result == 0) return (ENXIO);
66 + result2 = write (cache->FD_W, buf, len);
67 + if (result2 < 0) return (errno);
68 + if (result2 == 0) return (ENXIO);