util-linux-gcc4.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. diff -urN util-linux-2.12/disk-utils/mkfs.minix.c util-linux-2.12-patched/disk-utils/mkfs.minix.c
  2. --- util-linux-2.12/disk-utils/mkfs.minix.c 2005-04-30 21:38:42.924938555 -0500
  3. +++ util-linux-2.12-patched/disk-utils/mkfs.minix.c 2005-04-30 21:40:36.283237704 -0500
  4. @@ -124,17 +124,17 @@
  5. static char super_block_buffer[BLOCK_SIZE];
  6. static char boot_block_buffer[512];
  7. #define Super (*(struct minix_super_block *)super_block_buffer)
  8. -#define INODES ((unsigned long)Super.s_ninodes)
  9. +#define INODES (Super.s_ninodes)
  10. #ifdef HAVE_MINIX2
  11. -#define ZONES ((unsigned long)(version2 ? Super.s_zones : Super.s_nzones))
  12. +#define ZONES ((version2 ? Super.s_zones : Super.s_nzones))
  13. #else
  14. -#define ZONES ((unsigned long)(Super.s_nzones))
  15. +#define ZONES (Super.s_nzones)
  16. #endif
  17. -#define IMAPS ((unsigned long)Super.s_imap_blocks)
  18. -#define ZMAPS ((unsigned long)Super.s_zmap_blocks)
  19. -#define FIRSTZONE ((unsigned long)Super.s_firstdatazone)
  20. -#define ZONESIZE ((unsigned long)Super.s_log_zone_size)
  21. -#define MAXSIZE ((unsigned long)Super.s_max_size)
  22. +#define IMAPS (Super.s_imap_blocks)
  23. +#define ZMAPS (Super.s_zmap_blocks)
  24. +#define FIRSTZONE (Super.s_firstdatazone)
  25. +#define ZONESIZE (Super.s_log_zone_size)
  26. +#define MAXSIZE (Super.s_max_size)
  27. #define MAGIC (Super.s_magic)
  28. #define NORM_FIRSTZONE (2+IMAPS+ZMAPS+INODE_BLOCKS)
  29. @@ -436,7 +436,10 @@
  30. MAGIC = magic;
  31. ZONESIZE = 0;
  32. MAXSIZE = version2 ? 0x7fffffff : (7+512+512*512)*1024;
  33. - ZONES = BLOCKS;
  34. + if (version2)
  35. + Super.s_zones = BLOCKS;
  36. + else
  37. + Super.s_nzones = BLOCKS;
  38. /* some magic nrs: 1 inode / 3 blocks */
  39. if ( req_nr_inodes == 0 )
  40. @@ -478,11 +481,11 @@
  41. if (!inode_buffer)
  42. die(_("unable to allocate buffer for inodes"));
  43. memset(inode_buffer,0,INODE_BUFFER_SIZE);
  44. - printf(_("%ld inodes\n"),INODES);
  45. - printf(_("%ld blocks\n"),ZONES);
  46. - printf(_("Firstdatazone=%ld (%ld)\n"),FIRSTZONE,NORM_FIRSTZONE);
  47. + printf(_("%ld inodes\n"),(unsigned long)INODES);
  48. + printf(_("%ld blocks\n"),(unsigned long)ZONES);
  49. + printf(_("Firstdatazone=%ld (%ld)\n"),(unsigned long)FIRSTZONE,(unsigned long)NORM_FIRSTZONE);
  50. printf(_("Zonesize=%d\n"),BLOCK_SIZE<<ZONESIZE);
  51. - printf(_("Maxsize=%ld\n\n"),MAXSIZE);
  52. + printf(_("Maxsize=%ld\n\n"),(unsigned long)MAXSIZE);
  53. }
  54. /*