mkfs_minix, fsck_minix: code shrink
function old new delta fsck_minix_main 3092 3094 +2 next 539 538 -1 get_free_block 165 164 -1 check_zone_nr2 121 120 -1 alarm_intr 94 93 -1 recursive_check2 587 583 -4 recursive_check 587 583 -4 mkfs_minix_main 2974 2968 -6 map_block 237 231 -6 map_block2 341 333 -8 bad_zone 64 56 -8 write_block 619 610 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/11 up/down: 2/-49) Total: -47 bytes
This commit is contained in:
@ -121,8 +121,9 @@ enum { version2 = 0 };
|
||||
|
||||
enum { MAX_DEPTH = 32 };
|
||||
|
||||
enum { dev_fd = 3 };
|
||||
|
||||
struct globals {
|
||||
int dev_fd;
|
||||
#if ENABLE_FEATURE_MINIX2
|
||||
smallint version2;
|
||||
#endif
|
||||
@ -158,7 +159,6 @@ struct globals {
|
||||
};
|
||||
|
||||
#define G (*ptr_to_globals)
|
||||
#define dev_fd (G.dev_fd )
|
||||
#if ENABLE_FEATURE_MINIX2
|
||||
#define version2 (G.version2 )
|
||||
#endif
|
||||
@ -1223,7 +1223,7 @@ int fsck_minix_main(int argc ATTRIBUTE_UNUSED, char **argv)
|
||||
if (!isatty(0) || !isatty(1))
|
||||
die("need terminal for interactive repairs");
|
||||
}
|
||||
dev_fd = xopen(device_name, OPT_repair ? O_RDWR : O_RDONLY);
|
||||
xmove_fd(xopen(device_name, OPT_repair ? O_RDWR : O_RDONLY), dev_fd);
|
||||
|
||||
/*sync(); paranoia? */
|
||||
read_superblock();
|
||||
|
Reference in New Issue
Block a user