]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Add missing backwards compatibility for ancient Linux systems
authorTheodore Ts'o <tytso@mit.edu>
Mon, 29 May 2006 15:06:16 +0000 (11:06 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 29 May 2006 15:06:16 +0000 (11:06 -0400)
This fixes some (but not all) of the compatibility bugs which prevented
e2fsprogs from being compiled on a Linux 2.0.35 system.  There are still
some unprotected use of long long's, and apparently some type problems
with the uuid library, but these can be fixed up later.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
debugfs/ChangeLog
debugfs/util.c
e2fsck/ChangeLog
e2fsck/pass1b.c
misc/ChangeLog
misc/filefrag.c

index faca4a5821192c991743adc4aeca4919fbf6d238..33739082512916333d4fd803ba3f7ecb31e3e190 100644 (file)
@@ -1,3 +1,10 @@
+2006-05-29  Theodore Tso  <tytso@mit.edu>
+
+       * util.c (reset_getopt): In order to support ancient Linux header
+               files that don't define __GLIBC__ (but which were using
+               glibc anyway), assume that any system that defines
+               __linux__ should use the glibc method of resetting getopt().
+
 2006-05-28  Theodore Tso  <tytso@mit.edu>
 
        * unused.c (do_dump_unused): Use EXT2_MAX_BLOCK_SIZE instead of a
index cbbc99b5c40e5c5dafa629a342e036f7689ff780..c6096ab75a9b432b435b43fcb93db33eb748121a 100644 (file)
@@ -37,7 +37,7 @@ extern int optreset;          /* defined by BSD, but not others */
  * optind be set zero to reset its state.  So the unfortunate state of
  * affairs is that BSD-derived versions of getopt() misbehave if
  * optind is set to 0 in order to reset getopt(), and glibc's getopt()
- * will core ump if optind is set 1 in order to reset getopt().
+ * will core dump if optind is set 1 in order to reset getopt().
  * 
  * More modern versions of BSD require that optreset be set to 1 in
  * order to reset getopt().   Sigh.  Standards, anyone?
@@ -46,7 +46,7 @@ extern int optreset;          /* defined by BSD, but not others */
  */
 void reset_getopt(void)
 {
-#ifdef __GLIBC__
+#if defined(__GLIBC__) || defined(__linux__)
        optind = 0;
 #else
        optind = 1;
index 6f21380c31777949b4a6a5fef95f78a6cc03e732..6f2a735e5b64046234c282c51614a9fad3f11322 100644 (file)
@@ -1,3 +1,7 @@
+2006-05-29  Theodore Tso  <tytso@mit.edu>
+
+       * pass1b.c: Add missing semicolon when HAVE_INTPTR_T is not defined
+
 2006-05-22  Theodore Tso  <tytso@mit.edu>
 
        * e2fsck.8.in: Fixed spelling mistake.  (Addresses Debian Bug:
index 2b02b470a92af01b3576400a55e67d035dfa64f1..a9640ffa2c9aee099809f4c0c381839d875c42c9 100644 (file)
@@ -37,7 +37,7 @@
 #endif
 
 #ifndef HAVE_INTPTR_T
-typedef long intptr_t
+typedef long intptr_t;
 #endif
 
 /* Needed for architectures where sizeof(int) != sizeof(void *) */
index 7e34cd4d165a39704423e50f08c50932cf386a4a..a3fdf5bbee8aed67efabebae159a57ff9b33fa50 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-29  Theodore Tso  <tytso@mit.edu>
+
+       * filefrag.c: Add support for ancient Linux systems that do not
+               support the LFS api.
+
 2006-05-28  Theodore Tso  <tytso@mit.edu>
 
        * mke2fs.8.in (types): Clarify -T option description.
index 0a8b29dbe67fac7821927d592702962430ecc29c..5d144ffa35e7b862372ed58fa5c30ef9eaa56380 100644 (file)
@@ -69,7 +69,11 @@ static unsigned long get_bmap(int fd, unsigned long block)
 static void frag_report(const char *filename)
 {
        struct statfs   fsinfo;
+#ifdef HAVE_FSTAT64
        struct stat64   fileinfo;
+#else
+       struct stat     fileinfo;
+#endif
        int             bs;
        long            i, fd;
        unsigned long   block, last_block = 0, numblocks;
@@ -83,7 +87,11 @@ static void frag_report(const char *filename)
                perror("statfs");
                return;
        }
+#ifdef HAVE_FSTAT64
        if (stat64(filename, &fileinfo) < 0) {
+#else
+       if (stat(filename, &fileinfo) < 0) {
+#endif
                perror("stat");
                return;
        }
@@ -102,7 +110,11 @@ static void frag_report(const char *filename)
                printf("Filesystem cylinder groups is approximately %ld\n", 
                       cylgroups);
        }
-       fd = open(filename, O_RDONLY | O_LARGEFILE);
+#ifdef HAVE_OPEN64
+       fd = open64(filename, O_RDONLY);
+#else
+       fd = open(filename, O_RDONLY);
+#endif
        if (fd < 0) {
                perror("open");
                return;