$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ --- util-linux-2.12r.orig/fdisk/sfdisk.c 2005-01-04 23:31:57.000000000 +0100 +++ util-linux-2.12r/fdisk/sfdisk.c 2008-10-16 12:42:16.000000000 +0200 @@ -171,16 +171,6 @@ fatal(char *s, ...) { * * Note: we use 512-byte sectors here, irrespective of the hardware ss. */ -#undef use_lseek -#if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (__s390x__) -#define use_lseek -#endif - -#ifndef use_lseek -static __attribute__used -_syscall5(int, _llseek, unsigned int, fd, ulong, hi, ulong, lo, - loff_t *, res, unsigned int, wh); -#endif static int sseek(char *dev, unsigned int fd, unsigned long s) { @@ -188,12 +178,8 @@ sseek(char *dev, unsigned int fd, unsign in = ((loff_t) s << 9); out = 1; -#ifndef use_lseek - if (_llseek (fd, in>>32, in & 0xffffffff, &out, SEEK_SET) != 0) { -#else - if ((out = lseek(fd, in, SEEK_SET)) != in) { -#endif - perror("llseek"); + if ((out = lseek64(fd, in, SEEK_SET)) != in) { + perror("lseek64"); error(_("seek error on %s - cannot seek to %lu\n"), dev, s); return 0; } @@ -1730,12 +1716,12 @@ read_stdin(unsigned char **fields, unsig eof = 1; return RD_EOF; } - if (!(lp = index(lp, '\n'))) + if (!(lp = strchr(lp, '\n'))) fatal(_("long or incomplete input line - quitting\n")); *lp = 0; /* remove comments, if any */ - if ((lp = index(line+2, '#')) != 0) + if ((lp = strchr(line+2, '#')) != 0) *lp = 0; /* recognize a few commands - to be expanded */ @@ -1745,7 +1731,7 @@ read_stdin(unsigned char **fields, unsig } /* dump style? - then bad input is fatal */ - if ((ip = index(line+2, ':')) != 0) { + if ((ip = strchr(line+2, ':')) != 0) { struct dumpfld *d; nxtfld: @@ -2514,7 +2500,7 @@ main(int argc, char **argv) { if (argc < 1) fatal(_("no command?\n")); - if ((progn = rindex(argv[0], '/')) == NULL) + if ((progn = strrchr(argv[0], '/')) == NULL) progn = argv[0]; else progn++;