]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
ChangeLog, lsattr.c:
authorTheodore Ts'o <tytso@mit.edu>
Sun, 31 Dec 2000 13:55:14 +0000 (13:55 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 31 Dec 2000 13:55:14 +0000 (13:55 +0000)
  lsattr.c (list_attributes): Minor cleanup to smooth out logic flow.
   Also removed static initialized variables to zero.
ChangeLog, lsattr.1.in:
  lsattr.1.in: Add pointer to chattr man page for definition of the file
   attributes.

misc/ChangeLog
misc/lsattr.1.in
misc/lsattr.c

index 5d5e0c25acdc04724719bc4c03785f0b3dc3cbd0..d11fd8cdf0586110956f7b865fec29418db52ce0 100644 (file)
@@ -1,5 +1,11 @@
 2000-12-31    <tytso@snap.thunk.org>
 
+       * lsattr.1.in: Add pointer to chattr man page for definition of
+               the file attributes.
+
+       * lsattr.c (list_attributes): Minor cleanup to smooth out logic
+               flow.  Also removed static initialized variables to zero.
+
        * chattr.c (decode_arg, get_flag): Use a table-driven method for
                decoding the ext2 file flags character options.  Add
                support for the journaled data flag.
index 4b6877c2c91eebef4df32c6729454c8c9f71548c..4de54c9e562924aea6a225f1843cf0a6ad8c07db 100644 (file)
@@ -12,7 +12,9 @@ lsattr \- list file attributes on a Linux second extended file system
 ]
 .SH DESCRIPTION
 .B lsattr
-lists the file attributes on a second extended file system.
+lists the file attributes on a second extended file system.  See
+.BR chattr (1)
+for a description of the attributes and what they mean.
 .SH OPTIONS
 .TP
 .B \-R
index 9b9dc54a5ed9ee8362aff70c2b26bf6e73f10652..857c48185817f7ea623e69ec5ce36479a9761445 100644 (file)
@@ -45,12 +45,12 @@ extern char *optarg;
 
 static const char * program_name = "lsattr";
 
-static int all = 0;
-static int dirs_opt = 0;
-static unsigned pf_options = 0;
-static int recursive = 0;
-static int verbose = 0;
-static int generation_opt = 0;
+static int all;
+static int dirs_opt;
+static unsigned pf_options;
+static int recursive;
+static int verbose;
+static int generation_opt;
 
 static void usage(void)
 {
@@ -63,24 +63,27 @@ static void list_attributes (const char * name)
        unsigned long flags;
        unsigned long generation;
 
-       if (fgetflags (name, &flags) == -1)
+       if (fgetflags (name, &flags) == -1) {
                com_err (program_name, errno, _("While reading flags on %s"),
                         name);
-       else if (fgetversion (name, &generation) == -1)
-               com_err (program_name, errno, _("While reading version on %s"),
-                        name);
-       else
-       {
-               if (generation_opt)
-                       printf ("%5lu ", generation);
-               if (pf_options & PFOPT_LONG) {
-                       printf("%-28s ", name);
-                       print_flags(stdout, flags, pf_options);
-                       fputc('\n', stdout);
-               } else {
-                       print_flags(stdout, flags, pf_options);
-                       printf(" %s\n", name);
+               return;
+       }
+       if (generation_opt) {
+               if (fgetversion (name, &generation) == -1) {
+                       com_err (program_name, errno,
+                                _("While reading version on %s"),
+                                name);
+                       return;
                }
+               printf ("%5lu ", generation);
+       }
+       if (pf_options & PFOPT_LONG) {
+               printf("%-28s ", name);
+               print_flags(stdout, flags, pf_options);
+               fputc('\n', stdout);
+       } else {
+               print_flags(stdout, flags, pf_options);
+               printf(" %s\n", name);
        }
 }