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.

282 lines
10 KiB

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