summaryrefslogtreecommitdiff
path: root/util-linux/fsck_minix.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-06-25 10:00:58 +0000
committerDenis Vlasenko2008-06-25 10:00:58 +0000
commite06f61d27345f3b9727d58d46da99a47614f5a60 (patch)
tree1a44b70076954579eec605a50fc2afc95aeaae6e /util-linux/fsck_minix.c
parent7049ff8696c3c2a1be0f9901d7e2473568b8f918 (diff)
downloadbusybox-e06f61d27345f3b9727d58d46da99a47614f5a60.zip
busybox-e06f61d27345f3b9727d58d46da99a47614f5a60.tar.gz
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
Diffstat (limited to 'util-linux/fsck_minix.c')
-rw-r--r--util-linux/fsck_minix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index dba5241..cd17afa 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -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();