mirror of the now-defunct rocklinux.org
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.

263 lines
9.4 KiB

  1. diff -dur util-linux-2.12h/fdisk/cfdisk.c util-linux-2.12h-patch/fdisk/cfdisk.c
  2. --- util-linux-2.12h/fdisk/cfdisk.c 2004-09-27 15:54:13.000000000 +0000
  3. +++ util-linux-2.12h-patch/fdisk/cfdisk.c 2004-10-23 03:20:23.614040976 +0000
  4. @@ -82,9 +82,6 @@
  5. #include "xstrncpy.h"
  6. #include "common.h"
  7. -extern long long ext2_llseek(unsigned int fd, long long offset,
  8. - unsigned int origin);
  9. -
  10. #define VERSION UTIL_LINUX_VERSION
  11. #define DEFAULT_DEVICE "/dev/hda"
  12. @@ -545,16 +542,16 @@
  13. }
  14. static void
  15. -read_sector(char *buffer, long long sect_num) {
  16. - if (ext2_llseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0)
  17. +read_sector(char *buffer, off_t sect_num) {
  18. + if (lseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0)
  19. fatal(_("Cannot seek on disk drive"), 2);
  20. if (read(fd, buffer, SECTOR_SIZE) != SECTOR_SIZE)
  21. fatal(_("Cannot read disk drive"), 2);
  22. }
  23. static void
  24. -write_sector(char *buffer, long long sect_num) {
  25. - if (ext2_llseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0)
  26. +write_sector(char *buffer, off_t sect_num) {
  27. + if (lseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0)
  28. fatal(_("Cannot seek on disk drive"), 2);
  29. if (write(fd, buffer, SECTOR_SIZE) != SECTOR_SIZE)
  30. fatal(_("Cannot write disk drive"), 2);
  31. @@ -578,10 +575,10 @@
  32. #define DOS_OSTYPE_SZ 8
  33. #define DOS_LABEL_SZ 11
  34. #define DOS_FSTYPE_SZ 8
  35. - long long offset;
  36. + off_t offset;
  37. offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE;
  38. - if (ext2_llseek(fd, offset, SEEK_SET) == offset
  39. + if (lseek(fd, offset, SEEK_SET) == offset
  40. && read(fd, &sector, sizeof(sector)) == sizeof(sector)) {
  41. dos_copy_to_info(p_info[i].ostype, OSTYPESZ,
  42. sector+DOS_OSTYPE_OFFSET, DOS_OSTYPE_SZ);
  43. @@ -638,12 +635,12 @@
  44. } xfsb;
  45. char *label;
  46. - long long offset;
  47. + off_t offset;
  48. int j;
  49. offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE
  50. + 1024;
  51. - if (ext2_llseek(fd, offset, SEEK_SET) == offset
  52. + if (lseek(fd, offset, SEEK_SET) == offset
  53. && read(fd, &e2fsb, sizeof(e2fsb)) == sizeof(e2fsb)
  54. && e2fsb.s_magic[0] + (e2fsb.s_magic[1]<<8) == EXT2_SUPER_MAGIC) {
  55. label = e2fsb.s_volume_name;
  56. @@ -659,7 +656,7 @@
  57. }
  58. offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE + 0;
  59. - if (ext2_llseek(fd, offset, SEEK_SET) == offset
  60. + if (lseek(fd, offset, SEEK_SET) == offset
  61. && read(fd, &xfsb, sizeof(xfsb)) == sizeof(xfsb)
  62. && !strcmp(xfsb.s_magic, XFS_SUPER_MAGIC)) {
  63. label = xfsb.s_fname;
  64. @@ -673,7 +670,7 @@
  65. /* reiserfs? */
  66. offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE
  67. + REISERFS_DISK_OFFSET_IN_BYTES;
  68. - if (ext2_llseek(fd, offset, SEEK_SET) == offset
  69. + if (lseek(fd, offset, SEEK_SET) == offset
  70. && read(fd, &reiserfsb, 1024) == 1024
  71. && is_reiserfs_magic_string(&reiserfsb)) {
  72. strncpy(p_info[i].fstype, "reiserfs", FSTYPESZ);
  73. Nur in util-linux-2.12h-patch/fdisk: cfdisk.c~.
  74. diff -dur util-linux-2.12h/fdisk/fdiskbsdlabel.c util-linux-2.12h-patch/fdisk/fdiskbsdlabel.c
  75. --- util-linux-2.12h/fdisk/fdiskbsdlabel.c 2003-07-13 21:12:47.000000000 +0000
  76. +++ util-linux-2.12h-patch/fdisk/fdiskbsdlabel.c 2004-10-23 03:20:23.616040672 +0000
  77. @@ -566,7 +566,7 @@
  78. sector = get_start_sect(xbsd_part);
  79. #endif
  80. - if (ext2_llseek (fd, (long long) sector * SECTOR_SIZE, SEEK_SET) == -1)
  81. + if (lseek (fd, (off_t) sector * SECTOR_SIZE, SEEK_SET) == -1)
  82. fatal (unable_to_seek);
  83. if (BSD_BBSIZE != write (fd, disklabelbuffer, BSD_BBSIZE))
  84. fatal (unable_to_write);
  85. @@ -735,7 +735,7 @@
  86. sector = 0;
  87. #endif
  88. - if (ext2_llseek (fd, (long long) sector * SECTOR_SIZE, SEEK_SET) == -1)
  89. + if (lseek (fd, (off_t) sector * SECTOR_SIZE, SEEK_SET) == -1)
  90. fatal (unable_to_seek);
  91. if (BSD_BBSIZE != read (fd, disklabelbuffer, BSD_BBSIZE))
  92. fatal (unable_to_read);
  93. @@ -781,12 +781,12 @@
  94. #if defined (__alpha__) && BSD_LABELSECTOR == 0
  95. alpha_bootblock_checksum (disklabelbuffer);
  96. - if (ext2_llseek (fd, (long long) 0, SEEK_SET) == -1)
  97. + if (lseek (fd, (off_t) 0, SEEK_SET) == -1)
  98. fatal (unable_to_seek);
  99. if (BSD_BBSIZE != write (fd, disklabelbuffer, BSD_BBSIZE))
  100. fatal (unable_to_write);
  101. #else
  102. - if (ext2_llseek (fd, (long long) sector * SECTOR_SIZE + BSD_LABELOFFSET,
  103. + if (lseek (fd, (off_t) sector * SECTOR_SIZE + BSD_LABELOFFSET,
  104. SEEK_SET) == -1)
  105. fatal (unable_to_seek);
  106. if (sizeof (struct xbsd_disklabel) != write (fd, d, sizeof (struct xbsd_disklabel)))
  107. Nur in util-linux-2.12h-patch/fdisk: fdiskbsdlabel.c~.
  108. diff -dur util-linux-2.12h/fdisk/fdisk.c util-linux-2.12h-patch/fdisk/fdisk.c
  109. --- util-linux-2.12h/fdisk/fdisk.c 2004-09-06 20:36:16.000000000 +0000
  110. +++ util-linux-2.12h-patch/fdisk/fdisk.c 2004-10-23 03:20:23.619040216 +0000
  111. @@ -240,7 +240,7 @@
  112. static void
  113. seek_sector(int fd, unsigned int secno) {
  114. long long offset = (long long) secno * sector_size;
  115. - if (ext2_llseek(fd, offset, SEEK_SET) == (long long) -1)
  116. + if (lseek(fd, offset, SEEK_SET) == (off_t) -1)
  117. fatal(unable_to_seek);
  118. }
  119. Nur in util-linux-2.12h-patch/fdisk: fdisk.c~.
  120. diff -dur util-linux-2.12h/fdisk/fdisksgilabel.c util-linux-2.12h-patch/fdisk/fdisksgilabel.c
  121. --- util-linux-2.12h/fdisk/fdisksgilabel.c 2004-09-06 20:44:56.000000000 +0000
  122. +++ util-linux-2.12h-patch/fdisk/fdisksgilabel.c 2004-10-23 03:20:23.620040064 +0000
  123. @@ -377,7 +377,7 @@
  124. */
  125. sgiinfo *info = fill_sgiinfo();
  126. int infostartblock = SSWAP32(sgilabel->directory[0].vol_file_start);
  127. - if (ext2_llseek(fd, (long long)infostartblock*
  128. + if (lseek(fd, (off_t)infostartblock*
  129. SECTOR_SIZE, SEEK_SET) < 0)
  130. fatal(unable_to_seek);
  131. if (write(fd, info, SECTOR_SIZE) != SECTOR_SIZE)
  132. Nur in util-linux-2.12h-patch/fdisk: fdisksgilabel.c~.
  133. Nur in util-linux-2.12h/fdisk: llseek.c.
  134. diff -dur util-linux-2.12h/fdisk/Makefile util-linux-2.12h-patch/fdisk/Makefile
  135. --- util-linux-2.12h/fdisk/Makefile 2004-09-06 20:28:58.000000000 +0000
  136. +++ util-linux-2.12h-patch/fdisk/Makefile 2004-10-23 03:21:43.351918976 +0000
  137. @@ -39,7 +39,7 @@
  138. endif
  139. endif
  140. -cfdisk: cfdisk.o llseek.o disksize.o i386_sys_types.o $(LIB)/xstrncpy.o
  141. +cfdisk: cfdisk.o disksize.o i386_sys_types.o $(LIB)/xstrncpy.o
  142. ifeq "$(HAVE_SLANG)" "yes"
  143. $(CC) $(LDFLAGS) $^ -o $@ $(LIBSLANG)
  144. else
  145. @@ -55,7 +55,7 @@
  146. rm -f activate
  147. ln -s sfdisk activate
  148. -fdisk: fdisk.o llseek.o disksize.o fdiskbsdlabel.o fdisksgilabel.o \
  149. +fdisk: fdisk.o disksize.o fdiskbsdlabel.o fdisksgilabel.o \
  150. fdisksunlabel.o fdiskaixlabel.o i386_sys_types.o partname.o
  151. fdisk.o: fdisk.c fdisk.h
  152. fdiskbsdlabel.o: fdiskbsdlabel.c fdisk.h fdiskbsdlabel.h
  153. Nur in util-linux-2.12h-patch/fdisk: Makefile~.
  154. Nur in util-linux-2.12h-patch/fdisk: Makefile.rej.
  155. diff -dur util-linux-2.12h/fdisk/sfdisk.c util-linux-2.12h-patch/fdisk/sfdisk.c
  156. --- util-linux-2.12h/fdisk/sfdisk.c 2004-09-28 17:10:21.000000000 +0000
  157. +++ util-linux-2.12h-patch/fdisk/sfdisk.c 2004-10-23 03:27:03.788205256 +0000
  158. @@ -148,10 +148,7 @@
  159. /*
  160. * sseek: seek to specified sector - return 0 on failure
  161. *
  162. - * For >4GB disks lseek needs a > 32bit arg, and we have to use llseek.
  163. - * On the other hand, a 32 bit sector number is OK until 2TB.
  164. - * The routines _llseek and sseek below are the only ones that
  165. - * know about the loff_t type.
  166. + * This relies on _FILE_OFFSET_BITS=64.
  167. *
  168. * Note: we use 512-byte sectors here, irrespective of the hardware ss.
  169. */
  170. @@ -161,22 +158,15 @@
  171. #endif
  172. #ifndef use_lseek
  173. -static __attribute__used
  174. -_syscall5(int, _llseek, unsigned int, fd, ulong, hi, ulong, lo,
  175. - loff_t *, res, unsigned int, wh);
  176. #endif
  177. static int
  178. sseek(char *dev, unsigned int fd, unsigned long s) {
  179. - loff_t in, out;
  180. - in = ((loff_t) s << 9);
  181. + off_t in, out;
  182. + in = ((off_t) s << 9);
  183. out = 1;
  184. -#ifndef use_lseek
  185. - if (_llseek (fd, in>>32, in & 0xffffffff, &out, SEEK_SET) != 0) {
  186. -#else
  187. if ((out = lseek(fd, in, SEEK_SET)) != in) {
  188. -#endif
  189. perror("llseek");
  190. error(_("seek error on %s - cannot seek to %lu\n"), dev, s);
  191. return 0;
  192. Nur in util-linux-2.12h-patch/fdisk: sfdisk.c~.
  193. Nur in util-linux-2.12h-patch/fdisk: sfdisk.c.rej.
  194. Nur in util-linux-2.12h-patch/: MCONFIG~.
  195. Nur in util-linux-2.12h-patch/mount: mount.c~.
  196. diff -dur util-linux-2.12h/partx/partx.c util-linux-2.12h-patch/partx/partx.c
  197. --- util-linux-2.12h/partx/partx.c 2004-08-23 20:13:27.000000000 +0000
  198. +++ util-linux-2.12h-patch/partx/partx.c 2004-10-23 03:20:23.628038848 +0000
  199. @@ -332,30 +332,16 @@
  200. /*
  201. * sseek: seek to specified sector
  202. + *
  203. + * This relies on _FILE_OFFSET_BITS=64.
  204. */
  205. -#if !defined (__alpha__) && !defined (__ia64__) && !defined (__s390x__) && !defined(__x86_64__)
  206. -#define NEED__llseek
  207. -#endif
  208. -
  209. -#ifdef NEED__llseek
  210. -#include <linux/unistd.h> /* _syscall */
  211. -static
  212. -_syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo,
  213. - long long *, res, uint, wh);
  214. -#endif
  215. -
  216. static int
  217. sseek(int fd, unsigned int secnr) {
  218. - long long in, out;
  219. - in = ((long long) secnr << 9);
  220. + off_t in, out;
  221. + in = ((off_t) secnr << 9);
  222. out = 1;
  223. -#ifdef NEED__llseek
  224. - if (_llseek (fd, in>>32, in & 0xffffffff, &out, SEEK_SET) != 0
  225. - || out != in)
  226. -#else
  227. if ((out = lseek(fd, in, SEEK_SET)) != in)
  228. -#endif
  229. {
  230. fprintf(stderr, "llseek error\n");
  231. return -1;
  232. Nur in util-linux-2.12h-patch/partx: partx.c~.
  233. diff -dur util-linux-2.12h/po/POTFILES.in util-linux-2.12h-patch/po/POTFILES.in
  234. --- util-linux-2.12h/po/POTFILES.in 2004-09-07 01:02:39.000000000 +0000
  235. +++ util-linux-2.12h-patch/po/POTFILES.in 2004-10-23 03:20:23.622039760 +0000
  236. @@ -19,7 +19,6 @@
  237. fdisk/fdisksgilabel.c
  238. fdisk/fdisksunlabel.c
  239. fdisk/i386_sys_types.c
  240. -fdisk/llseek.c
  241. fdisk/partname.c
  242. fdisk/sfdisk.c
  243. getopt/getopt.c
  244. Nur in util-linux-2.12h-patch/po: POTFILES.in~.