From: Theodore Ts'o Date: Tue, 13 Nov 2001 23:49:09 +0000 (-0500) Subject: util.c (check_plausibility): Use stat64 if available so that X-Git-Tag: WIP-20011130~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ef3920a82c8fb3dad78409eca9d5f3d1b66176b;p=thirdparty%2Fe2fsprogs.git util.c (check_plausibility): Use stat64 if available so that check_plausibility() works with files > 2GB. --- diff --git a/misc/ChangeLog b/misc/ChangeLog index d3e9aa5e1..79388d17a 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,8 @@ +2001-11-13 Theodore Tso + + * util.c (check_plausibility): Use stat64 if available so that + check_plausibility() works with files > 2GB. + 2001-11-05 Theodore Tso * chattr.1.in: Update the man page to document the EXT2_NOTAIL_FL diff --git a/misc/util.c b/misc/util.c index 98ad0b25a..1160e6b8a 100644 --- a/misc/util.c +++ b/misc/util.c @@ -9,6 +9,9 @@ * %End-Header% */ +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE + #include #include #ifdef HAVE_ERRNO_H @@ -62,9 +65,15 @@ void proceed_question(void) void check_plausibility(const char *device) { int val; +#ifdef HAVE_OPEN64 + struct stat64 s; + + val = stat64(device, &s); +#else struct stat s; val = stat(device, &s); +#endif if(val == -1) { fprintf(stderr, _("Could not stat %s --- %s\n"),