patch-src_mkfs_fat_c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. --- dosfstools-3.0.26.orig/src/mkfs.fat.c 2014-02-08 18:53:10.000000000 +0100
  2. +++ dosfstools-3.0.26/src/mkfs.fat.c 2014-03-26 13:37:51.000000000 +0100
  3. @@ -300,7 +300,7 @@ static long do_check(char *buffer, int t
  4. static void alarm_intr(int alnum);
  5. static void check_blocks(void);
  6. static void get_list_blocks(char *filename);
  7. -static int valid_offset(int fd, loff_t offset);
  8. +static int valid_offset(int fd, off_t offset);
  9. static uint64_t count_blocks(char *filename, int *remainder);
  10. static void check_mount(char *device_name);
  11. static void establish_params(int device_num, int size);
  12. @@ -477,7 +477,7 @@ static void get_list_blocks(char *filena
  13. /* Given a file descriptor and an offset, check whether the offset is a valid offset for the file - return FALSE if it
  14. isn't valid or TRUE if it is */
  15. -static int valid_offset(int fd, loff_t offset)
  16. +static int valid_offset(int fd, off_t offset)
  17. {
  18. char ch;
  19. @@ -492,7 +492,7 @@ static int valid_offset(int fd, loff_t o
  20. static uint64_t count_blocks(char *filename, int *remainder)
  21. {
  22. - loff_t high, low;
  23. + off_t high, low;
  24. int fd;
  25. if ((fd = open(filename, O_RDONLY)) < 0) {
  26. @@ -506,7 +506,7 @@ static uint64_t count_blocks(char *filen
  27. for (high = 1; valid_offset(fd, high); high *= 2)
  28. low = high;
  29. while (low < high - 1) {
  30. - const loff_t mid = (low + high) / 2;
  31. + const off_t mid = (low + high) / 2;
  32. if (valid_offset(fd, mid))
  33. low = mid;
  34. else
  35. @@ -1299,7 +1299,7 @@ static void setup_tables(void)
  36. #define seekto(pos,errstr) \
  37. do { \
  38. - loff_t __pos = (pos); \
  39. + off_t __pos = (pos); \
  40. if (llseek (dev, __pos, SEEK_SET) != __pos) \
  41. error ("seek to " errstr " failed whilst writing tables"); \
  42. } while(0)
  43. @@ -1679,7 +1679,7 @@ int main(int argc, char **argv)
  44. exit(1); /* The error exit code is 1! */
  45. }
  46. } else {
  47. - loff_t offset = blocks * BLOCK_SIZE - 1;
  48. + off_t offset = blocks * BLOCK_SIZE - 1;
  49. char null = 0;
  50. /* create the file */
  51. dev = open(device_name, O_EXCL | O_RDWR | O_CREAT | O_TRUNC, 0666);