]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
util.c (check_plausibility): Use stat64 if available so that
authorTheodore Ts'o <tytso@mit.edu>
Tue, 13 Nov 2001 23:49:09 +0000 (18:49 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 13 Nov 2001 23:49:09 +0000 (18:49 -0500)
check_plausibility() works with files > 2GB.

misc/ChangeLog
misc/util.c

index d3e9aa5e1145362845dfb3b1b67c075178de2405..79388d17adfa5022a8e475596db8e1e73c7a1d8a 100644 (file)
@@ -1,3 +1,8 @@
+2001-11-13  Theodore Tso  <tytso@valinux.com>
+
+       * util.c (check_plausibility): Use stat64 if available so that
+               check_plausibility() works with files > 2GB.
+
 2001-11-05  Theodore Tso  <tytso@valinux.com>
 
        * chattr.1.in: Update the man page to document the EXT2_NOTAIL_FL
index 98ad0b25a73f25a6dda072c8264f1ac461edd060..1160e6b8a36a7e7b4422c8b18ce6d76840919166 100644 (file)
@@ -9,6 +9,9 @@
  * %End-Header%
  */
 
+#define _LARGEFILE_SOURCE
+#define _LARGEFILE64_SOURCE
+
 #include <stdio.h>
 #include <string.h>
 #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"),