diff options
author | vapier <vapier@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-06-11 00:08:50 +0000 |
---|---|---|
committer | vapier <vapier@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-06-11 00:08:50 +0000 |
commit | 1736adf2b8f17cfbd7ff088efe9e3f77cf51d400 (patch) | |
tree | 6890b22c5a78b5166952d173a7d1a2bd94afca1b | |
parent | eb6a5fd3274092fa918cca43472c53c6f2ee46b5 (diff) | |
download | busybox-w32-1736adf2b8f17cfbd7ff088efe9e3f77cf51d400.tar.gz busybox-w32-1736adf2b8f17cfbd7ff088efe9e3f77cf51d400.tar.bz2 busybox-w32-1736adf2b8f17cfbd7ff088efe9e3f77cf51d400.zip |
recode functions to shrink size
git-svn-id: svn://busybox.net/trunk/busybox@10509 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r-- | e2fsprogs/e2p/e2p.h | 4 | ||||
-rw-r--r-- | e2fsprogs/e2p/feature.c | 21 | ||||
-rw-r--r-- | e2fsprogs/e2p/hashstr.c | 21 | ||||
-rw-r--r-- | e2fsprogs/e2p/ls.c | 109 | ||||
-rw-r--r-- | e2fsprogs/e2p/ostype.c | 14 | ||||
-rw-r--r-- | e2fsprogs/e2p/pe.c | 22 | ||||
-rw-r--r-- | e2fsprogs/e2p/pf.c | 1 | ||||
-rw-r--r-- | e2fsprogs/e2p/ps.c | 7 | ||||
-rw-r--r-- | e2fsprogs/e2p/uuid.c | 2 |
9 files changed, 92 insertions, 109 deletions
diff --git a/e2fsprogs/e2p/e2p.h b/e2fsprogs/e2p/e2p.h index 78930ec17..57bcec31f 100644 --- a/e2fsprogs/e2p/e2p.h +++ b/e2fsprogs/e2p/e2p.h | |||
@@ -1,3 +1,4 @@ | |||
1 | #include "busybox.h" | ||
1 | #include <sys/types.h> /* Needed by dirent.h on netbsd */ | 2 | #include <sys/types.h> /* Needed by dirent.h on netbsd */ |
2 | #include <stdio.h> | 3 | #include <stdio.h> |
3 | #include <dirent.h> | 4 | #include <dirent.h> |
@@ -30,8 +31,9 @@ int getversion (int fd, unsigned long * version); | |||
30 | int iterate_on_dir (const char * dir_name, | 31 | int iterate_on_dir (const char * dir_name, |
31 | int (*func) (const char *, struct dirent *, void *), | 32 | int (*func) (const char *, struct dirent *, void *), |
32 | void * private); | 33 | void * private); |
33 | void list_super(struct ext2_super_block * s); | 34 | /*void list_super(struct ext2_super_block * s);*/ |
34 | void list_super2(struct ext2_super_block * s, FILE *f); | 35 | void list_super2(struct ext2_super_block * s, FILE *f); |
36 | #define list_super(s) list_super2(s, stdout) | ||
35 | void print_fs_errors (FILE * f, unsigned short errors); | 37 | void print_fs_errors (FILE * f, unsigned short errors); |
36 | void print_flags (FILE * f, unsigned long flags, unsigned options); | 38 | void print_flags (FILE * f, unsigned long flags, unsigned options); |
37 | void print_fs_state (FILE * f, unsigned short state); | 39 | void print_fs_state (FILE * f, unsigned short state); |
diff --git a/e2fsprogs/e2p/feature.c b/e2fsprogs/e2p/feature.c index ef11d93b7..f4e920a98 100644 --- a/e2fsprogs/e2p/feature.c +++ b/e2fsprogs/e2p/feature.c | |||
@@ -56,10 +56,10 @@ static struct feature feature_list[] = { | |||
56 | 56 | ||
57 | const char *e2p_feature2string(int compat, unsigned int mask) | 57 | const char *e2p_feature2string(int compat, unsigned int mask) |
58 | { | 58 | { |
59 | struct feature *f; | 59 | struct feature *f; |
60 | static char buf[20]; | 60 | static char buf[20]; |
61 | char fchar; | 61 | char fchar; |
62 | int fnum; | 62 | int fnum; |
63 | 63 | ||
64 | for (f = feature_list; f->string; f++) { | 64 | for (f = feature_list; f->string; f++) { |
65 | if ((compat == f->compat) && | 65 | if ((compat == f->compat) && |
@@ -67,7 +67,7 @@ const char *e2p_feature2string(int compat, unsigned int mask) | |||
67 | return f->string; | 67 | return f->string; |
68 | } | 68 | } |
69 | switch (compat) { | 69 | switch (compat) { |
70 | case E2P_FEATURE_COMPAT: | 70 | case E2P_FEATURE_COMPAT: |
71 | fchar = 'C'; | 71 | fchar = 'C'; |
72 | break; | 72 | break; |
73 | case E2P_FEATURE_INCOMPAT: | 73 | case E2P_FEATURE_INCOMPAT: |
@@ -81,15 +81,15 @@ const char *e2p_feature2string(int compat, unsigned int mask) | |||
81 | break; | 81 | break; |
82 | } | 82 | } |
83 | for (fnum = 0; mask >>= 1; fnum++); | 83 | for (fnum = 0; mask >>= 1; fnum++); |
84 | sprintf(buf, "FEATURE_%c%d", fchar, fnum); | 84 | sprintf(buf, "FEATURE_%c%d", fchar, fnum); |
85 | return buf; | 85 | return buf; |
86 | } | 86 | } |
87 | 87 | ||
88 | int e2p_string2feature(char *string, int *compat_type, unsigned int *mask) | 88 | int e2p_string2feature(char *string, int *compat_type, unsigned int *mask) |
89 | { | 89 | { |
90 | struct feature *f; | 90 | struct feature *f; |
91 | char *eptr; | 91 | char *eptr; |
92 | int num; | 92 | int num; |
93 | 93 | ||
94 | for (f = feature_list; f->string; f++) { | 94 | for (f = feature_list; f->string; f++) { |
95 | if (!strcasecmp(string, f->string)) { | 95 | if (!strcasecmp(string, f->string)) { |
@@ -128,14 +128,14 @@ int e2p_string2feature(char *string, int *compat_type, unsigned int *mask) | |||
128 | return 0; | 128 | return 0; |
129 | } | 129 | } |
130 | 130 | ||
131 | static char *skip_over_blanks(char *cp) | 131 | static inline char *skip_over_blanks(char *cp) |
132 | { | 132 | { |
133 | while (*cp && isspace(*cp)) | 133 | while (*cp && isspace(*cp)) |
134 | cp++; | 134 | cp++; |
135 | return cp; | 135 | return cp; |
136 | } | 136 | } |
137 | 137 | ||
138 | static char *skip_over_word(char *cp) | 138 | static inline char *skip_over_word(char *cp) |
139 | { | 139 | { |
140 | while (*cp && !isspace(*cp) && *cp != ',') | 140 | while (*cp && !isspace(*cp) && *cp != ',') |
141 | cp++; | 141 | cp++; |
@@ -187,4 +187,3 @@ int e2p_edit_feature(const char *str, __u32 *compat_array, __u32 *ok_array) | |||
187 | } | 187 | } |
188 | return 0; | 188 | return 0; |
189 | } | 189 | } |
190 | |||
diff --git a/e2fsprogs/e2p/hashstr.c b/e2fsprogs/e2p/hashstr.c index b257eb26c..7c0552f09 100644 --- a/e2fsprogs/e2p/hashstr.c +++ b/e2fsprogs/e2p/hashstr.c | |||
@@ -17,20 +17,20 @@ | |||
17 | #include "e2p.h" | 17 | #include "e2p.h" |
18 | 18 | ||
19 | struct hash { | 19 | struct hash { |
20 | int num; | 20 | int num; |
21 | const char *string; | 21 | const char *string; |
22 | }; | 22 | }; |
23 | 23 | ||
24 | static struct hash hash_list[] = { | 24 | static struct hash hash_list[] = { |
25 | { EXT2_HASH_LEGACY, "legacy" }, | 25 | { EXT2_HASH_LEGACY, "legacy" }, |
26 | { EXT2_HASH_HALF_MD4, "half_md4" }, | 26 | { EXT2_HASH_HALF_MD4, "half_md4" }, |
27 | { EXT2_HASH_TEA, "tea" }, | 27 | { EXT2_HASH_TEA, "tea" }, |
28 | { 0, 0 }, | 28 | { 0, 0 }, |
29 | }; | 29 | }; |
30 | 30 | ||
31 | const char *e2p_hash2string(int num) | 31 | const char *e2p_hash2string(int num) |
32 | { | 32 | { |
33 | struct hash *p; | 33 | struct hash *p; |
34 | static char buf[20]; | 34 | static char buf[20]; |
35 | 35 | ||
36 | for (p = hash_list; p->string; p++) { | 36 | for (p = hash_list; p->string; p++) { |
@@ -46,9 +46,9 @@ const char *e2p_hash2string(int num) | |||
46 | */ | 46 | */ |
47 | int e2p_string2hash(char *string) | 47 | int e2p_string2hash(char *string) |
48 | { | 48 | { |
49 | struct hash *p; | 49 | struct hash *p; |
50 | char *eptr; | 50 | char *eptr; |
51 | int num; | 51 | int num; |
52 | 52 | ||
53 | for (p = hash_list; p->string; p++) { | 53 | for (p = hash_list; p->string; p++) { |
54 | if (!strcasecmp(string, p->string)) { | 54 | if (!strcasecmp(string, p->string)) { |
@@ -67,4 +67,3 @@ int e2p_string2hash(char *string) | |||
67 | return -1; | 67 | return -1; |
68 | return num; | 68 | return num; |
69 | } | 69 | } |
70 | |||
diff --git a/e2fsprogs/e2p/ls.c b/e2fsprogs/e2p/ls.c index e8d9d482d..71f8f5126 100644 --- a/e2fsprogs/e2p/ls.c +++ b/e2fsprogs/e2p/ls.c | |||
@@ -20,28 +20,18 @@ | |||
20 | 20 | ||
21 | #include "e2p.h" | 21 | #include "e2p.h" |
22 | 22 | ||
23 | static void print_user (unsigned short uid, FILE *f) | 23 | static void print_user(unsigned short uid, FILE *f) |
24 | { | 24 | { |
25 | struct passwd *pw; | 25 | struct passwd *pw = getpwuid(uid); |
26 | 26 | fprintf(f, "%u (user %s)\n", uid, | |
27 | fprintf(f, "%u ", uid); | 27 | (pw == NULL ? "unknown" : pw->pw_name)); |
28 | pw = getpwuid (uid); | ||
29 | if (pw == NULL) | ||
30 | fprintf(f, "(user unknown)\n"); | ||
31 | else | ||
32 | fprintf(f, "(user %s)\n", pw->pw_name); | ||
33 | } | 28 | } |
34 | 29 | ||
35 | static void print_group (unsigned short gid, FILE *f) | 30 | static void print_group(unsigned short gid, FILE *f) |
36 | { | 31 | { |
37 | struct group *gr; | 32 | struct group *gr = getgrgid(gid); |
38 | 33 | fprintf(f, "%u (group %s)\n", gid, | |
39 | fprintf(f, "%u ", gid); | 34 | (gr == NULL ? "unknown" : gr->gr_name)); |
40 | gr = getgrgid (gid); | ||
41 | if (gr == NULL) | ||
42 | fprintf(f, "(group unknown)\n"); | ||
43 | else | ||
44 | fprintf(f, "(group %s)\n", gr->gr_name); | ||
45 | } | 35 | } |
46 | 36 | ||
47 | #define MONTH_INT (86400 * 30) | 37 | #define MONTH_INT (86400 * 30) |
@@ -167,10 +157,12 @@ void list_super2(struct ext2_super_block * sb, FILE *f) | |||
167 | strncpy(buf, sb->s_last_mounted, sizeof(sb->s_last_mounted)); | 157 | strncpy(buf, sb->s_last_mounted, sizeof(sb->s_last_mounted)); |
168 | } else | 158 | } else |
169 | strcpy(buf, "<not available>"); | 159 | strcpy(buf, "<not available>"); |
170 | fprintf(f, "Last mounted on: %s\n", buf); | 160 | fprintf(f, |
171 | fprintf(f, "Filesystem UUID: %s\n", e2p_uuid2str(sb->s_uuid)); | 161 | "Last mounted on: %s\n" |
172 | fprintf(f, "Filesystem magic number: 0x%04X\n", sb->s_magic); | 162 | "Filesystem UUID: %s\n" |
173 | fprintf(f, "Filesystem revision #: %d", sb->s_rev_level); | 163 | "Filesystem magic number: 0x%04X\n" |
164 | "Filesystem revision #: %d", | ||
165 | buf, e2p_uuid2str(sb->s_uuid), sb->s_magic, sb->s_rev_level); | ||
174 | if (sb->s_rev_level == EXT2_GOOD_OLD_REV) { | 166 | if (sb->s_rev_level == EXT2_GOOD_OLD_REV) { |
175 | fprintf(f, " (original)\n"); | 167 | fprintf(f, " (original)\n"); |
176 | #ifdef EXT2_DYNAMIC_REV | 168 | #ifdef EXT2_DYNAMIC_REV |
@@ -183,28 +175,34 @@ void list_super2(struct ext2_super_block * sb, FILE *f) | |||
183 | print_mntopts(sb, f); | 175 | print_mntopts(sb, f); |
184 | fprintf(f, "Filesystem state: "); | 176 | fprintf(f, "Filesystem state: "); |
185 | print_fs_state (f, sb->s_state); | 177 | print_fs_state (f, sb->s_state); |
186 | fprintf(f, "\n"); | 178 | fprintf(f, "\nErrors behavior: "); |
187 | fprintf(f, "Errors behavior: "); | ||
188 | print_fs_errors(f, sb->s_errors); | 179 | print_fs_errors(f, sb->s_errors); |
189 | fprintf(f, "\n"); | ||
190 | str = e2p_os2string(sb->s_creator_os); | 180 | str = e2p_os2string(sb->s_creator_os); |
191 | fprintf(f, "Filesystem OS type: %s\n", str); | 181 | fprintf(f, |
182 | "\n" | ||
183 | "Filesystem OS type: %s\n" | ||
184 | "Inode count: %u\n" | ||
185 | "Block count: %u\n" | ||
186 | "Reserved block count: %u\n" | ||
187 | "Free blocks: %u\n" | ||
188 | "Free inodes: %u\n" | ||
189 | "First block: %u\n" | ||
190 | "Block size: %u\n" | ||
191 | "Fragment size: %u\n", | ||
192 | str, sb->s_inodes_count, sb->s_blocks_count, sb->s_r_blocks_count, | ||
193 | sb->s_free_blocks_count, sb->s_free_inodes_count, | ||
194 | sb->s_first_data_block, EXT2_BLOCK_SIZE(sb), EXT2_FRAG_SIZE(sb)); | ||
192 | free(str); | 195 | free(str); |
193 | fprintf(f, "Inode count: %u\n", sb->s_inodes_count); | ||
194 | fprintf(f, "Block count: %u\n", sb->s_blocks_count); | ||
195 | fprintf(f, "Reserved block count: %u\n", sb->s_r_blocks_count); | ||
196 | fprintf(f, "Free blocks: %u\n", sb->s_free_blocks_count); | ||
197 | fprintf(f, "Free inodes: %u\n", sb->s_free_inodes_count); | ||
198 | fprintf(f, "First block: %u\n", sb->s_first_data_block); | ||
199 | fprintf(f, "Block size: %u\n", EXT2_BLOCK_SIZE(sb)); | ||
200 | fprintf(f, "Fragment size: %u\n", EXT2_FRAG_SIZE(sb)); | ||
201 | if (sb->s_reserved_gdt_blocks) | 196 | if (sb->s_reserved_gdt_blocks) |
202 | fprintf(f, "Reserved GDT blocks: %u\n", | 197 | fprintf(f, "Reserved GDT blocks: %u\n", |
203 | sb->s_reserved_gdt_blocks); | 198 | sb->s_reserved_gdt_blocks); |
204 | fprintf(f, "Blocks per group: %u\n", sb->s_blocks_per_group); | 199 | fprintf(f, |
205 | fprintf(f, "Fragments per group: %u\n", sb->s_frags_per_group); | 200 | "Blocks per group: %u\n" |
206 | fprintf(f, "Inodes per group: %u\n", sb->s_inodes_per_group); | 201 | "Fragments per group: %u\n" |
207 | fprintf(f, "Inode blocks per group: %u\n", inode_blocks_per_group); | 202 | "Inodes per group: %u\n" |
203 | "Inode blocks per group: %u\n", | ||
204 | sb->s_blocks_per_group, sb->s_frags_per_group, | ||
205 | sb->s_inodes_per_group, inode_blocks_per_group); | ||
208 | if (sb->s_first_meta_bg) | 206 | if (sb->s_first_meta_bg) |
209 | fprintf(f, "First meta block group: %u\n", | 207 | fprintf(f, "First meta block group: %u\n", |
210 | sb->s_first_meta_bg); | 208 | sb->s_first_meta_bg); |
@@ -216,13 +214,17 @@ void list_super2(struct ext2_super_block * sb, FILE *f) | |||
216 | fprintf(f, "Last mount time: %s", | 214 | fprintf(f, "Last mount time: %s", |
217 | sb->s_mtime ? ctime(&tm) : "n/a\n"); | 215 | sb->s_mtime ? ctime(&tm) : "n/a\n"); |
218 | tm = sb->s_wtime; | 216 | tm = sb->s_wtime; |
219 | fprintf(f, "Last write time: %s", ctime(&tm)); | 217 | fprintf(f, |
220 | fprintf(f, "Mount count: %u\n", sb->s_mnt_count); | 218 | "Last write time: %s" |
221 | fprintf(f, "Maximum mount count: %d\n", sb->s_max_mnt_count); | 219 | "Mount count: %u\n" |
220 | "Maximum mount count: %d\n", | ||
221 | ctime(&tm), sb->s_mnt_count, sb->s_max_mnt_count); | ||
222 | tm = sb->s_lastcheck; | 222 | tm = sb->s_lastcheck; |
223 | fprintf(f, "Last checked: %s", ctime(&tm)); | 223 | fprintf(f, |
224 | fprintf(f, "Check interval: %u (%s)\n", sb->s_checkinterval, | 224 | "Last checked: %s" |
225 | interval_string(sb->s_checkinterval)); | 225 | "Check interval: %u (%s)\n", |
226 | ctime(&tm), | ||
227 | sb->s_checkinterval, interval_string(sb->s_checkinterval)); | ||
226 | if (sb->s_checkinterval) | 228 | if (sb->s_checkinterval) |
227 | { | 229 | { |
228 | time_t next; | 230 | time_t next; |
@@ -235,8 +237,10 @@ void list_super2(struct ext2_super_block * sb, FILE *f) | |||
235 | fprintf(f, "Reserved blocks gid: "); | 237 | fprintf(f, "Reserved blocks gid: "); |
236 | print_group(sb->s_def_resgid, f); | 238 | print_group(sb->s_def_resgid, f); |
237 | if (sb->s_rev_level >= EXT2_DYNAMIC_REV) { | 239 | if (sb->s_rev_level >= EXT2_DYNAMIC_REV) { |
238 | fprintf(f, "First inode: %d\n", sb->s_first_ino); | 240 | fprintf(f, |
239 | fprintf(f, "Inode size: %d\n", sb->s_inode_size); | 241 | "First inode: %d\n" |
242 | "Inode size: %d\n", | ||
243 | sb->s_first_ino, sb->s_inode_size); | ||
240 | } | 244 | } |
241 | if (!e2p_is_null_uuid(sb->s_journal_uuid)) | 245 | if (!e2p_is_null_uuid(sb->s_journal_uuid)) |
242 | fprintf(f, "Journal UUID: %s\n", | 246 | fprintf(f, "Journal UUID: %s\n", |
@@ -259,18 +263,9 @@ void list_super2(struct ext2_super_block * sb, FILE *f) | |||
259 | e2p_uuid2str(sb->s_hash_seed)); | 263 | e2p_uuid2str(sb->s_hash_seed)); |
260 | if (sb->s_jnl_backup_type) { | 264 | if (sb->s_jnl_backup_type) { |
261 | fprintf(f, "Journal backup: "); | 265 | fprintf(f, "Journal backup: "); |
262 | switch (sb->s_jnl_backup_type) { | 266 | if (sb->s_jnl_backup_type == 1) |
263 | case 1: | ||
264 | fprintf(f, "inode blocks\n"); | 267 | fprintf(f, "inode blocks\n"); |
265 | break; | 268 | else |
266 | default: | ||
267 | fprintf(f, "type %u\n", sb->s_jnl_backup_type); | 269 | fprintf(f, "type %u\n", sb->s_jnl_backup_type); |
268 | } | ||
269 | } | 270 | } |
270 | } | 271 | } |
271 | |||
272 | void list_super (struct ext2_super_block * s) | ||
273 | { | ||
274 | list_super2(s, stdout); | ||
275 | } | ||
276 | |||
diff --git a/e2fsprogs/e2p/ostype.c b/e2fsprogs/e2p/ostype.c index fe6597dd5..a079b57b1 100644 --- a/e2fsprogs/e2p/ostype.c +++ b/e2fsprogs/e2p/ostype.c | |||
@@ -23,17 +23,17 @@ const char *os_tab[] = | |||
23 | */ | 23 | */ |
24 | char *e2p_os2string(int os_type) | 24 | char *e2p_os2string(int os_type) |
25 | { | 25 | { |
26 | const char *os; | 26 | const char *os; |
27 | char *ret; | 27 | char *ret; |
28 | 28 | ||
29 | if (os_type <= EXT2_OS_LITES) | 29 | if (os_type <= EXT2_OS_LITES) |
30 | os = os_tab[os_type]; | 30 | os = os_tab[os_type]; |
31 | else | 31 | else |
32 | os = "(unknown os)"; | 32 | os = "(unknown os)"; |
33 | 33 | ||
34 | ret = malloc(strlen(os)+1); | 34 | ret = xmalloc(strlen(os)+1); |
35 | strcpy(ret, os); | 35 | strcpy(ret, os); |
36 | return ret; | 36 | return ret; |
37 | } | 37 | } |
38 | 38 | ||
39 | /* | 39 | /* |
@@ -41,8 +41,8 @@ char *e2p_os2string(int os_type) | |||
41 | */ | 41 | */ |
42 | int e2p_string2os(char *str) | 42 | int e2p_string2os(char *str) |
43 | { | 43 | { |
44 | const char **cpp; | 44 | const char **cpp; |
45 | int i = 0; | 45 | int i = 0; |
46 | 46 | ||
47 | for (cpp = os_tab; *cpp; cpp++, i++) { | 47 | for (cpp = os_tab; *cpp; cpp++, i++) { |
48 | if (!strcasecmp(str, *cpp)) | 48 | if (!strcasecmp(str, *cpp)) |
diff --git a/e2fsprogs/e2p/pe.c b/e2fsprogs/e2p/pe.c index 4cce69117..07fb88694 100644 --- a/e2fsprogs/e2p/pe.c +++ b/e2fsprogs/e2p/pe.c | |||
@@ -18,20 +18,14 @@ | |||
18 | 18 | ||
19 | #include "e2p.h" | 19 | #include "e2p.h" |
20 | 20 | ||
21 | void print_fs_errors (FILE * f, unsigned short errors) | 21 | void print_fs_errors(FILE *f, unsigned short errors) |
22 | { | 22 | { |
23 | switch (errors) | 23 | char *disp = NULL; |
24 | { | 24 | switch (errors) { |
25 | case EXT2_ERRORS_CONTINUE: | 25 | case EXT2_ERRORS_CONTINUE: disp = "Continue"; break; |
26 | fprintf (f, "Continue"); | 26 | case EXT2_ERRORS_RO: disp = "Remount read-only"; break; |
27 | break; | 27 | case EXT2_ERRORS_PANIC: disp = "Panic"; break; |
28 | case EXT2_ERRORS_RO: | 28 | default: disp = "Unknown (continue)"; |
29 | fprintf (f, "Remount read-only"); | ||
30 | break; | ||
31 | case EXT2_ERRORS_PANIC: | ||
32 | fprintf (f, "Panic"); | ||
33 | break; | ||
34 | default: | ||
35 | fprintf (f, "Unknown (continue)"); | ||
36 | } | 29 | } |
30 | fprintf(f, disp); | ||
37 | } | 31 | } |
diff --git a/e2fsprogs/e2p/pf.c b/e2fsprogs/e2p/pf.c index 48d75a9ae..d1a1c4caa 100644 --- a/e2fsprogs/e2p/pf.c +++ b/e2fsprogs/e2p/pf.c | |||
@@ -71,4 +71,3 @@ void print_flags (FILE * f, unsigned long flags, unsigned options) | |||
71 | if (long_opt && first) | 71 | if (long_opt && first) |
72 | fputs("---", f); | 72 | fputs("---", f); |
73 | } | 73 | } |
74 | |||
diff --git a/e2fsprogs/e2p/ps.c b/e2fsprogs/e2p/ps.c index bec8b4195..b7c0ee2f1 100644 --- a/e2fsprogs/e2p/ps.c +++ b/e2fsprogs/e2p/ps.c | |||
@@ -18,12 +18,9 @@ | |||
18 | 18 | ||
19 | #include "e2p.h" | 19 | #include "e2p.h" |
20 | 20 | ||
21 | void print_fs_state (FILE * f, unsigned short state) | 21 | void print_fs_state(FILE *f, unsigned short state) |
22 | { | 22 | { |
23 | if (state & EXT2_VALID_FS) | 23 | fprintf(f, (state & EXT2_VALID_FS ? " clean" : " not clean")); |
24 | fprintf (f, " clean"); | ||
25 | else | ||
26 | fprintf (f, " not clean"); | ||
27 | if (state & EXT2_ERROR_FS) | 24 | if (state & EXT2_ERROR_FS) |
28 | fprintf (f, " with errors"); | 25 | fprintf (f, " with errors"); |
29 | } | 26 | } |
diff --git a/e2fsprogs/e2p/uuid.c b/e2fsprogs/e2p/uuid.c index fef3b91e7..c16a76842 100644 --- a/e2fsprogs/e2p/uuid.c +++ b/e2fsprogs/e2p/uuid.c | |||
@@ -70,10 +70,8 @@ void e2p_uuid_to_str(void *uu, char *out) | |||
70 | const char *e2p_uuid2str(void *uu) | 70 | const char *e2p_uuid2str(void *uu) |
71 | { | 71 | { |
72 | static char buf[80]; | 72 | static char buf[80]; |
73 | |||
74 | if (e2p_is_null_uuid(uu)) | 73 | if (e2p_is_null_uuid(uu)) |
75 | return "<none>"; | 74 | return "<none>"; |
76 | e2p_uuid_to_str(uu, buf); | 75 | e2p_uuid_to_str(uu, buf); |
77 | return buf; | 76 | return buf; |
78 | } | 77 | } |
79 | |||