aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2020-03-22 23:30:14 -0400
committerTheodore Ts'o <tytso@mit.edu>2020-03-23 21:21:00 -0400
commit1df6a455505b483bd493acb97be9c4c719064700 (patch)
tree72b96d5cdbe8784270b65a2814788e04d716ae8e
parent29d22c467547f11f4db31331549ee4e304eeb220 (diff)
downloade2fsprogs-1df6a455505b483bd493acb97be9c4c719064700.tar.gz
Use ext2_loff_t instead of loff_t
The loff_t type is a glibc'ism and is not fully portable. Use ext2_loff_t instead. Fixes: 382ed4a1c2b6 ("e2fsck: use proper types for variables") Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reported-by: Matthias Andree <matthias.andree@gmx.de>
-rw-r--r--lib/ext2fs/imager.c2
-rw-r--r--misc/e2fuzz.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/ext2fs/imager.c b/lib/ext2fs/imager.c
index b3ede9a86..1aebe625c 100644
--- a/lib/ext2fs/imager.c
+++ b/lib/ext2fs/imager.c
@@ -67,7 +67,7 @@ errcode_t ext2fs_image_inode_write(ext2_filsys fs, int fd, int flags)
blk64_t blk;
ssize_t actual;
errcode_t retval;
- loff_t r;
+ ext2_loff_t r;
buf = malloc(fs->blocksize * BUF_BLOCKS);
if (!buf)
diff --git a/misc/e2fuzz.c b/misc/e2fuzz.c
index 7c0f776fe..685cdbe29 100644
--- a/misc/e2fuzz.c
+++ b/misc/e2fuzz.c
@@ -33,9 +33,10 @@ static unsigned long long user_corrupt_bytes = 0;
static double user_corrupt_pct = 0.0;
#if !defined HAVE_PWRITE64 && !defined HAVE_PWRITE
-static ssize_t my_pwrite(int fd, const void *buf, size_t count, off_t offset)
+static ssize_t my_pwrite(int fd, const void *buf, size_t count,
+ ext2_loff_t offset)
{
- if (lseek(fd, offset, SEEK_SET) < 0)
+ if (ext2fs_llseek(fd, offset, SEEK_SET) < 0)
return 0;
return write(fd, buf, count);
@@ -82,7 +83,7 @@ static int find_block_helper(ext2_filsys fs EXT2FS_ATTR((unused)),
}
static errcode_t find_metadata_blocks(ext2_filsys fs, ext2fs_block_bitmap bmap,
- off_t *corrupt_bytes)
+ ext2_loff_t *corrupt_bytes)
{
dgrp_t i;
blk64_t b, c;
@@ -181,9 +182,8 @@ static int process_fs(const char *fsname)
int flags, fd;
ext2_filsys fs = NULL;
ext2fs_block_bitmap corrupt_map;
- loff_t hsize, count, off, offset, corrupt_bytes;
+ ext2_loff_t hsize, count, off, offset, corrupt_bytes, i;
unsigned char c;
- loff_t i;
/* If mounted rw, force dryrun mode */
ret = ext2fs_check_if_mounted(fsname, &flags);