Whamcloud - gitweb
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 d3e9aa5..79388d1 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 98ad0b2..1160e6b 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"),