You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.3 KiB

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