diff options
author | Theodore Ts'o <tytso@mit.edu> | 2006-05-29 11:06:16 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2006-05-29 11:06:16 -0400 |
commit | 9c07dc00b8ea175aa1446868b5cca5a21b41aecf (patch) | |
tree | e1f42324ad056e8fb1ec7586628fe6b0f4cf4281 /debugfs | |
parent | 2c83031791778d132747b73e76c892a16f4b2da6 (diff) | |
download | e2fsprogs-9c07dc00b8ea175aa1446868b5cca5a21b41aecf.tar.gz |
Add missing backwards compatibility for ancient Linux systems
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>
Diffstat (limited to 'debugfs')
-rw-r--r-- | debugfs/ChangeLog | 7 | ||||
-rw-r--r-- | debugfs/util.c | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog index faca4a58..33739082 100644 --- a/debugfs/ChangeLog +++ b/debugfs/ChangeLog @@ -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 diff --git a/debugfs/util.c b/debugfs/util.c index cbbc99b5..c6096ab7 100644 --- a/debugfs/util.c +++ b/debugfs/util.c @@ -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; |