From 9bbcf43f882c29ef2003950d8e3d468f05996205 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 26 Jan 2015 12:12:30 +0100 Subject: 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 Signed-off-by: Karel Zak --- disk-utils/fdisk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'disk-utils/fdisk.c') 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); -- cgit v1.2.3-55-g7522