openwrt-packages/utils/hfsprogs/patches/0011-Fix-types.patch

70 lines
2.1 KiB
Diff

From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
Date: Thu, 24 Oct 2013 01:11:22 -0200
Subject: Fix types
---
fsck_hfs.tproj/cache.c | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
--- a/fsck_hfs.tproj/cache.c
+++ b/fsck_hfs.tproj/cache.c
@@ -961,20 +961,21 @@ int CacheLookup (Cache_t *cache, uint64_
*/
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 CacheRawRead (Cache_t *cache, uint64
*/
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++;