summaryrefslogtreecommitdiffstats
path: root/disk-utils/fdisk.c
diff options
context:
space:
mode:
authorKarel Zak2015-01-26 12:12:30 +0100
committerKarel Zak2015-01-26 12:26:00 +0100
commit9bbcf43f882c29ef2003950d8e3d468f05996205 (patch)
tree760c8ee12190881b6fee5fef09ff77831a1f7be8 /disk-utils/fdisk.c
parentlibmount: add options map to docs (diff)
downloadkernel-qcow2-util-linux-9bbcf43f882c29ef2003950d8e3d468f05996205.tar.gz
kernel-qcow2-util-linux-9bbcf43f882c29ef2003950d8e3d468f05996205.tar.xz
kernel-qcow2-util-linux-9bbcf43f882c29ef2003950d8e3d468f05996205.zip
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/fdisk.c')
-rw-r--r--disk-utils/fdisk.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/disk-utils/fdisk.c b/disk-utils/fdisk.c
index 6f20a310f..8807940ec 100644
--- a/disk-utils/fdisk.c
+++ b/disk-utils/fdisk.c
@@ -568,7 +568,7 @@ static void dump_buffer(off_t base, unsigned char *buf, size_t sz, int all)
}
static void dump_blkdev(struct fdisk_context *cxt, const char *name,
- off_t offset, size_t size, int all)
+ uint64_t offset, size_t size, int all)
{
int fd = fdisk_get_devfd(cxt);
@@ -577,7 +577,7 @@ static void dump_blkdev(struct fdisk_context *cxt, const char *name,
assert(fd >= 0);
- if (lseek(fd, offset, SEEK_SET) == (off_t) -1)
+ if (lseek(fd, (off_t) offset, SEEK_SET) == (off_t) -1)
fdisk_warn(cxt, _("cannot seek"));
else {
unsigned char *buf = xmalloc(size);
@@ -604,7 +604,7 @@ void dump_disklabel(struct fdisk_context *cxt)
int all = !isatty(STDOUT_FILENO);
int i = 0;
const char *name = NULL;
- off_t offset = 0;
+ uint64_t offset = 0;
size_t size = 0;
assert(cxt);