summaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorDenis Vlasenko2007-09-23 14:05:54 +0000
committerDenis Vlasenko2007-09-23 14:05:54 +0000
commit06b3cc281108ce585bf33113aa36b29ea0b446cd (patch)
tree6048c7ef1a9f7b6055eb80515bd9c877b820923c /util-linux
parent32a471e4db43b5c1115084d02d8cf54db2098a72 (diff)
downloadbusybox-06b3cc281108ce585bf33113aa36b29ea0b446cd.zip
busybox-06b3cc281108ce585bf33113aa36b29ea0b446cd.tar.gz
make fdisk compile on libc without llseek64
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/fdisk.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c
index 2a91a8f..7981abc 100644
--- a/util-linux/fdisk.c
+++ b/util-linux/fdisk.c
@@ -638,8 +638,16 @@ static void
seek_sector(ullong secno)
{
secno *= sector_size;
+#if ENABLE_FDISK_SUPPORT_LARGE_DISKS
if (lseek64(fd, (off64_t)secno, SEEK_SET) == (off64_t) -1)
fdisk_fatal(unable_to_seek);
+#else
+ if (secno > MAXINT(off_t)
+ || lseek(fd, (off_t)secno, SEEK_SET) == (off_t) -1
+ ) {
+ fdisk_fatal(unable_to_seek);
+ }
+#endif
}
#if ENABLE_FEATURE_FDISK_WRITABLE