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);
}
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;
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);