summaryrefslogtreecommitdiff
path: root/debugfs
diff options
context:
space:
mode:
Diffstat (limited to 'debugfs')
-rw-r--r--debugfs/ChangeLog7
-rw-r--r--debugfs/debugfs.c4
-rw-r--r--debugfs/dump.c2
-rw-r--r--debugfs/htree.c4
-rw-r--r--debugfs/logdump.c2
-rw-r--r--debugfs/ls.c2
6 files changed, 14 insertions, 7 deletions
diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog
index 184ab2aa..88583a61 100644
--- a/debugfs/ChangeLog
+++ b/debugfs/ChangeLog
@@ -1,3 +1,10 @@
+2003-03-06 Theodore Tso <tytso@mit.edu>
+
+ * debugfs.c (do_open_filesys, do_show_super_stats),
+ ls.c (do_list_dir), dump.c (do_dump), htree.c (do_htree_dump,
+ do_dx_hash), logdump.c (do_logdump): Reset optind to 1 for better
+ compatibility with non-glibc implementations of getopt.
+
2003-03-01 Theodore Ts'o <tytso@mit.edu>
* Makefile.in, logdump.c (do_logdump): Use the blkid functions to
diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index 22941046..a9a6c63d 100644
--- a/debugfs/debugfs.c
+++ b/debugfs/debugfs.c
@@ -101,7 +101,7 @@ void do_open_filesys(int argc, char **argv)
blk_t blocksize = 0;
int open_flags = 0;
- optind = 0;
+ optind = 1;
#ifdef HAVE_OPTRESET
optreset = 1; /* Makes BSD getopt happy */
#endif
@@ -242,7 +242,7 @@ void do_show_super_stats(int argc, char *argv[])
int numdirs = 0;
const char *usage = "Usage: show_super [-h]";
- optind = 0;
+ optind = 1;
#ifdef HAVE_OPTRESET
optreset = 1; /* Makes BSD getopt happy */
#endif
diff --git a/debugfs/dump.c b/debugfs/dump.c
index e9227f0f..303f7e18 100644
--- a/debugfs/dump.c
+++ b/debugfs/dump.c
@@ -149,7 +149,7 @@ void do_dump(int argc, char **argv)
const char *dump_usage = "Usage: dump_inode [-p] <file> <output_file>";
char *in_fn, *out_fn;
- optind = 0;
+ optind = 1;
#ifdef HAVE_OPTRESET
optreset = 1; /* Makes BSD getopt happy */
#endif
diff --git a/debugfs/htree.c b/debugfs/htree.c
index 13c0916d..b9403d97 100644
--- a/debugfs/htree.c
+++ b/debugfs/htree.c
@@ -193,7 +193,7 @@ void do_htree_dump(int argc, char *argv[])
pager = open_pager();
- optind = 0;
+ optind = 1;
#ifdef HAVE_OPTRESET
optreset = 1; /* Makes BSD getopt happy */
#endif
@@ -277,7 +277,7 @@ void do_dx_hash(int argc, char *argv[])
__u32 hash_seed[4];
hash_seed[0] = hash_seed[1] = hash_seed[2] = hash_seed[3] = 0;
- optind = 0;
+ optind = 1;
#ifdef HAVE_OPTRESET
optreset = 1; /* Makes BSD getopt happy */
#endif
diff --git a/debugfs/logdump.c b/debugfs/logdump.c
index df11c162..1e195ba9 100644
--- a/debugfs/logdump.c
+++ b/debugfs/logdump.c
@@ -92,7 +92,7 @@ void do_logdump(int argc, char **argv)
struct journal_source journal_source;
struct ext2_super_block *es = NULL;
- optind = 0;
+ optind = 1;
#ifdef HAVE_OPTRESET
optreset = 1; /* Makes BSD getopt happy */
#endif
diff --git a/debugfs/ls.c b/debugfs/ls.c
index 3064598d..a66482dc 100644
--- a/debugfs/ls.c
+++ b/debugfs/ls.c
@@ -125,7 +125,7 @@ void do_list_dir(int argc, char *argv[])
if (check_fs_open(argv[0]))
return;
- optind = 0;
+ optind = 1;
#ifdef HAVE_OPTRESET
optreset = 1; /* Makes BSD getopt happy */
#endif