From 050112183b0578220df675331b23381abcfb2c65 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Wed, 15 Jan 2014 15:41:03 +0000 Subject: [PATCH] _LARGEFILE_SOURCE --- realloc-inodes.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/realloc-inodes.c b/realloc-inodes.c index 3607794..19826de 100644 --- a/realloc-inodes.c +++ b/realloc-inodes.c @@ -73,6 +73,9 @@ * - reallocation on a bigalloc filesystem */ +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE + #include #include #include @@ -705,7 +708,7 @@ int main(int narg, char **args) realloc_data rd = { 0 }; int optind, retval, io_flags = 0, force = 0; io_manager io_ptr = unix_io_manager; - struct stat st_buf; + struct stat64 st_buf; for (optind = 1; optind < narg; optind++) { if (!strcmp(args[optind], "--patch")) @@ -742,7 +745,8 @@ int main(int narg, char **args) com_err(program_name, errno, _("while opening %s"), rd.device_name); exit(1); } - retval = fstat(rd.fs_fd, &st_buf); + // FIXME Don't know why, but it segfaults if I use ext2fs_fstat here! (of course with ext2fs_struct_stat) + retval = fstat64(rd.fs_fd, &st_buf); if (retval < 0) { com_err(program_name, errno, _("while getting stat information for %s"), rd.device_name);