summaryrefslogtreecommitdiff
path: root/e2fsprogs/lsattr.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-04-15 11:48:27 +0000
committerDenis Vlasenko2007-04-15 11:48:27 +0000
commit8acf521432b75923c8ece0b4633a25062e30c255 (patch)
tree419c8b72017d869f736cb5d6e1bf732b78d655cf /e2fsprogs/lsattr.c
parentbe1a9d4237662f179e2b8f6c7bffd747f3f8fd73 (diff)
downloadbusybox-8acf521432b75923c8ece0b4633a25062e30c255.zip
busybox-8acf521432b75923c8ece0b4633a25062e30c255.tar.gz
e2fsprogs: stop using statics in chattr. Minor code shrinkage (-130 bytes)
Diffstat (limited to 'e2fsprogs/lsattr.c')
-rw-r--r--e2fsprogs/lsattr.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/e2fsprogs/lsattr.c b/e2fsprogs/lsattr.c
index 8945b53..25d2e3e 100644
--- a/e2fsprogs/lsattr.c
+++ b/e2fsprogs/lsattr.c
@@ -34,11 +34,11 @@ static void list_attributes(const char *name)
unsigned long fsflags;
unsigned long generation;
- if (fgetflags(name, &fsflags) == -1)
+ if (fgetflags(name, &fsflags) != 0)
goto read_err;
if (option_mask32 & OPT_GENERATION) {
- if (fgetversion(name, &generation) == -1)
+ if (fgetversion(name, &generation) != 0)
goto read_err;
printf("%5lu ", generation);
}
@@ -65,14 +65,12 @@ static int lsattr_dir_proc(const char *dir_name, struct dirent *de,
path = concat_path_file(dir_name, de->d_name);
- if (lstat(path, &st) == -1)
+ if (lstat(path, &st) != 0)
bb_perror_msg("stat %s", path);
-
else if (de->d_name[0] != '.' || (option_mask32 & OPT_ALL)) {
list_attributes(path);
if (S_ISDIR(st.st_mode) && (option_mask32 & OPT_RECUR)
- && (de->d_name[0] != '.'
- || (de->d_name[1] != '\0' && NOT_LONE_CHAR(de->d_name+1, '.')))
+ && !DOT_OR_DOTDOT(de->d_name)
) {
printf("\n%s:\n", path);
iterate_on_dir(path, lsattr_dir_proc, NULL);
@@ -81,7 +79,6 @@ static int lsattr_dir_proc(const char *dir_name, struct dirent *de,
}
free(path);
-
return 0;
}