aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRichard Genoud <richard.genoud@gmail.com>2012-09-12 16:38:34 +0200
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-09-25 18:06:50 +0300
commitf3f3a208048eac5f8b5752a17ebcd44db9230fd8 (patch)
tree2f697e448f84cf55ecaebcb19f6fc1b10d54e303 /lib
parent4f1b10827b81cd9acaa9e02b0da0dc447f1471ea (diff)
consistency between u_int32_t / off_t / off64_t
We should use the off_t type instead of off64_t or u_int32_t as its length is controlled by the WITHOUT_LARGEFILE flag. Signed-off-by: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/libmtd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libmtd.c b/lib/libmtd.c
index c4836df..654490e 100644
--- a/lib/libmtd.c
+++ b/lib/libmtd.c
@@ -1063,8 +1063,8 @@ int mtd_read(const struct mtd_dev_info *mtd, int fd, int eb, int offs,
/* Seek to the beginning of the eraseblock */
seek = (off_t)eb * mtd->eb_size + offs;
if (lseek(fd, seek, SEEK_SET) != seek)
- return sys_errmsg("cannot seek mtd%d to offset %llu",
- mtd->mtd_num, (unsigned long long)seek);
+ return sys_errmsg("cannot seek mtd%d to offset %"PRIdoff_t,
+ mtd->mtd_num, seek);
while (rd < len) {
ret = read(fd, buf, len);
@@ -1171,8 +1171,8 @@ int mtd_write(libmtd_t desc, const struct mtd_dev_info *mtd, int fd, int eb,
if (data) {
/* Seek to the beginning of the eraseblock */
if (lseek(fd, seek, SEEK_SET) != seek)
- return sys_errmsg("cannot seek mtd%d to offset %llu",
- mtd->mtd_num, (unsigned long long)seek);
+ return sys_errmsg("cannot seek mtd%d to offset %"PRIdoff_t,
+ mtd->mtd_num, seek);
ret = write(fd, data, len);
if (ret != len)
return sys_errmsg("cannot write %d bytes to mtd%d "
@@ -1329,8 +1329,8 @@ int mtd_write_img(const struct mtd_dev_info *mtd, int fd, int eb, int offs,
/* Seek to the beginning of the eraseblock */
seek = (off_t)eb * mtd->eb_size + offs;
if (lseek(fd, seek, SEEK_SET) != seek) {
- sys_errmsg("cannot seek mtd%d to offset %llu",
- mtd->mtd_num, (unsigned long long)seek);
+ sys_errmsg("cannot seek mtd%d to offset %"PRIdoff_t,
+ mtd->mtd_num, seek);
goto out_close;
}