summaryrefslogtreecommitdiff
path: root/util-linux/fdisk.c
diff options
context:
space:
mode:
authorEric Andersen2004-03-30 09:21:54 +0000
committerEric Andersen2004-03-30 09:21:54 +0000
commit0a92f3570224f3529b2f46431f44b69dd0ab64bd (patch)
tree25bea023fee99bc6d0e7636e9bcf2f253d9f2897 /util-linux/fdisk.c
parent259cf97803dd6e3e9f7d11a84e5313f1ee93b7b5 (diff)
downloadbusybox-0a92f3570224f3529b2f46431f44b69dd0ab64bd.zip
busybox-0a92f3570224f3529b2f46431f44b69dd0ab64bd.tar.gz
As waldi noticed, checks for the size of an off_t and casting
etc was also redundant and possibly buggy...
Diffstat (limited to 'util-linux/fdisk.c')
-rw-r--r--util-linux/fdisk.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c
index e9ef5ce..96517da 100644
--- a/util-linux/fdisk.c
+++ b/util-linux/fdisk.c
@@ -93,13 +93,6 @@
#endif
-#if defined(CONFIG_LFS) || defined(__alpha__) || defined(__ia64__) || defined(__s390x__)
-typedef long long fdisk_loff_t;
-#else
-typedef long fdisk_loff_t;
-#endif
-
-
/* including <linux/hdreg.h> also fails */
struct hd_geometry {
unsigned char heads;
@@ -1372,7 +1365,7 @@ xbsd_write_bootstrap (void)
sector = get_start_sect(xbsd_part);
#endif
- if (lseek (fd, (fdisk_loff_t) sector * SECTOR_SIZE, SEEK_SET) == -1)
+ if (lseek (fd, sector * SECTOR_SIZE, SEEK_SET) == -1)
fdisk_fatal (unable_to_seek);
if (BSD_BBSIZE != write (fd, disklabelbuffer, BSD_BBSIZE))
fdisk_fatal (unable_to_write);
@@ -1540,7 +1533,7 @@ xbsd_readlabel (struct partition *p, struct xbsd_disklabel *d)
sector = 0;
#endif
- if (lseek (fd, (fdisk_loff_t) sector * SECTOR_SIZE, SEEK_SET) == -1)
+ if (lseek (fd, sector * SECTOR_SIZE, SEEK_SET) == -1)
fdisk_fatal (unable_to_seek);
if (BSD_BBSIZE != read (fd, disklabelbuffer, BSD_BBSIZE))
fdisk_fatal (unable_to_read);
@@ -1586,12 +1579,12 @@ xbsd_writelabel (struct partition *p, struct xbsd_disklabel *d)
#if defined (__alpha__) && BSD_LABELSECTOR == 0
alpha_bootblock_checksum (disklabelbuffer);
- if (lseek (fd, (fdisk_loff_t) 0, SEEK_SET) == -1)
+ if (lseek (fd, 0, SEEK_SET) == -1)
fdisk_fatal (unable_to_seek);
if (BSD_BBSIZE != write (fd, disklabelbuffer, BSD_BBSIZE))
fdisk_fatal (unable_to_write);
#else
- if (lseek (fd, (fdisk_loff_t) sector * SECTOR_SIZE + BSD_LABELOFFSET,
+ if (lseek (fd, sector * SECTOR_SIZE + BSD_LABELOFFSET,
SEEK_SET) == -1)
fdisk_fatal (unable_to_seek);
if (sizeof (struct xbsd_disklabel) != write (fd, d, sizeof (struct xbsd_disklabel)))
@@ -3401,8 +3394,8 @@ static void fdisk_fatal(enum failure why) {
static void
seek_sector(uint secno) {
- fdisk_loff_t offset = (fdisk_loff_t) secno * sector_size;
- if (lseek(fd, offset, SEEK_SET) == (fdisk_loff_t) -1)
+ off_t offset = secno * sector_size;
+ if (lseek(fd, offset, SEEK_SET) == (off_t) -1)
fdisk_fatal(unable_to_seek);
}