@@ -832,7 +832,7 @@ main(int argc, char **argv)
if (write_last_block) {
/* ensure regular files are correctly sized */
- if (ftruncate64(target[i].fd, mp->m_sb.sb_dblocks *
+ if (ftruncate(target[i].fd, mp->m_sb.sb_dblocks *
source_blocksize)) {
do_log(_("%s: cannot grow data section.\n"),
progname);
@@ -1451,7 +1451,7 @@ packfile(char *fname, char *tname, int fd,
}
}
}
- if (ftruncate64(tfd, statp->bs_size) < 0) {
+ if (ftruncate(tfd, statp->bs_size) < 0) {
fsrprintf(_("could not truncate tmpfile: %s : %s\n"),
fname, strerror(errno));
goto out;
@@ -144,7 +144,6 @@ typedef int64_t xfs_daddr_t;
#define lseek64 lseek
#define pread64 pread
#define pwrite64 pwrite
-#define ftruncate64 ftruncate
#define fdatasync fsync
#define memalign(a,sz) valloc(sz)
@@ -34,7 +34,6 @@
#define __LITTLE_ENDIAN LITTLE_ENDIAN
/* FreeBSD file API is 64-bit aware */
-#define ftruncate64 ftruncate
#define lseek64 lseek
#define pwrite64 pwrite
#define pread64 pread
@@ -72,9 +72,9 @@ copy_src_filesize(int fd)
static int
copy_dst_truncate(void)
{
- int ret = ftruncate64(file->fd, 0);
+ int ret = ftruncate(file->fd, 0);
if (ret < 0)
- perror("ftruncate64");
+ perror("ftruncate");
return ret;
}
@@ -38,7 +38,7 @@ truncate_f(
return 0;
}
- if (ftruncate64(file->fd, offset) < 0) {
+ if (ftruncate(file->fd, offset) < 0) {
perror("ftruncate");
return 0;
}
@@ -124,7 +124,7 @@ perform_restore(
if (is_target_file) {
/* ensure regular files are correctly sized */
- if (ftruncate64(dst_fd, sb.sb_dblocks * sb.sb_blocksize))
+ if (ftruncate(dst_fd, sb.sb_dblocks * sb.sb_blocksize))
fatal("cannot set filesystem image size: %s\n",
strerror(errno));
} else {
@@ -2815,7 +2815,7 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
* code will succeed.
*/
if (xi.disfile && xi.dsize * xi.dbsize < dblocks * blocksize) {
- if (ftruncate64(xi.dfd, dblocks * blocksize) < 0) {
+ if (ftruncate(xi.dfd, dblocks * blocksize) < 0) {
fprintf(stderr,
_("%s: Growing the data section failed\n"),
progname);
Signed-off-by: Felix Janda <felix.janda@posteo.de> --- copy/xfs_copy.c | 2 +- fsr/xfs_fsr.c | 2 +- include/darwin.h | 1 - include/freebsd.h | 1 - io/copy_file_range.c | 4 ++-- io/truncate.c | 2 +- mdrestore/xfs_mdrestore.c | 2 +- mkfs/xfs_mkfs.c | 2 +- 8 files changed, 7 insertions(+), 9 deletions(-)