mirror of https://github.com/vitalif/e2fsprogs
ChangeLog, lsattr.c:
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.bitmap-optimize
parent
9a71884968
commit
f10748d88c
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue