http://git.etherboot.org
/
people
/
mcb30
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
94147af
)
make fdisk compile on libc without llseek64
author
vda
<vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>
Sun, 23 Sep 2007 14:05:54 +0000
(14:05 +0000)
committer
vda
<vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>
Sun, 23 Sep 2007 14:05:54 +0000
(14:05 +0000)
git-svn-id: svn://busybox.net/trunk/busybox@19968
69ca8d6d
-28ef-0310-b511-
8ec308f3f277
util-linux/fdisk.c
patch
|
blob
|
history
diff --git
a/util-linux/fdisk.c
b/util-linux/fdisk.c
index
2a91a8f
..
7981abc
100644
(file)
--- 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