aboutsummaryrefslogtreecommitdiffstats
path: root/disk-utils/sfdisk.c
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2015-01-26 12:12:30 +0100
committerKarel Zak <kzak@redhat.com>2015-01-26 12:26:00 +0100
commit9bbcf43f882c29ef2003950d8e3d468f05996205 (patch)
tree760c8ee12190881b6fee5fef09ff77831a1f7be8 /disk-utils/sfdisk.c
parent3df1a79ad5ed1d54af58a4c26c208c65e53e3f6c (diff)
downloadutil-linux-9bbcf43f882c29ef2003950d8e3d468f05996205.tar.gz
libfdisk: don't use off_t in public API
It's better to use exact and explicitly defined types (e.g. uint64_t) rather than something like off_t to make code more portable. [reported with gcc (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3)] The patch also fixes one debug message. Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/sfdisk.c')
-rw-r--r--disk-utils/sfdisk.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c
index eed9180abf..f9f733b48f 100644
--- a/disk-utils/sfdisk.c
+++ b/disk-utils/sfdisk.c
@@ -225,7 +225,7 @@ static void backup_sectors(struct sfdisk *sf,
const char *tpl,
const char *name,
const char *devname,
- off_t offset, size_t size)
+ uint64_t offset, size_t size)
{
char *fname;
int fd, devfd;
@@ -239,7 +239,7 @@ static void backup_sectors(struct sfdisk *sf,
if (fd < 0)
goto fail;
- if (lseek(devfd, offset, SEEK_SET) == (off_t) -1) {
+ if (lseek(devfd, (off_t) offset, SEEK_SET) == (off_t) -1) {
fdisk_warn(sf->cxt, _("cannot seek %s"), devname);
goto fail;
} else {
@@ -269,7 +269,7 @@ static void backup_partition_table(struct sfdisk *sf, const char *devname)
{
const char *name;
char *tpl;
- off_t offset = 0;
+ uint64_t offset = 0;
size_t size = 0;
int i = 0;