diff options
author | Karel Zak | 2006-12-07 00:27:13 +0100 |
---|---|---|
committer | Karel Zak | 2006-12-07 00:27:13 +0100 |
commit | cf6d7faebb6f6989dbf4bac25081e50eafb640ee (patch) | |
tree | 8353e2919ea0146d61e5cdcb76200d1e8929b1af /fdisk/sfdisk.c | |
parent | Imported from util-linux-2.13-pre5 tarball. (diff) | |
download | kernel-qcow2-util-linux-cf6d7faebb6f6989dbf4bac25081e50eafb640ee.tar.gz kernel-qcow2-util-linux-cf6d7faebb6f6989dbf4bac25081e50eafb640ee.tar.xz kernel-qcow2-util-linux-cf6d7faebb6f6989dbf4bac25081e50eafb640ee.zip |
Imported from util-linux-2.13-pre6 tarball.
Diffstat (limited to 'fdisk/sfdisk.c')
-rw-r--r-- | fdisk/sfdisk.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/fdisk/sfdisk.c b/fdisk/sfdisk.c index b859ef565..6e9e5697a 100644 --- a/fdisk/sfdisk.c +++ b/fdisk/sfdisk.c @@ -162,36 +162,17 @@ fatal(char *s, ...) { /* * sseek: seek to specified sector - return 0 on failure * - * For >4GB disks lseek needs a > 32bit arg, and we have to use llseek. - * On the other hand, a 32 bit sector number is OK until 2TB. - * The routines _llseek and sseek below are the only ones that - * know about the loff_t type. - * * 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) { - loff_t in, out; - in = ((loff_t) s << 9); + off_t in, out; + in = ((off_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"); + perror("lseek"); error(_("seek error on %s - cannot seek to %lu\n"), dev, s); return 0; } |