summaryrefslogtreecommitdiff
path: root/util-linux/fsck_minix.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-06-25 10:00:58 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-06-25 10:00:58 +0000
commite06f61d27345f3b9727d58d46da99a47614f5a60 (patch)
tree1a44b70076954579eec605a50fc2afc95aeaae6e /util-linux/fsck_minix.c
parent7049ff8696c3c2a1be0f9901d7e2473568b8f918 (diff)
downloadbusybox-w32-e06f61d27345f3b9727d58d46da99a47614f5a60.tar.gz
busybox-w32-e06f61d27345f3b9727d58d46da99a47614f5a60.tar.bz2
busybox-w32-e06f61d27345f3b9727d58d46da99a47614f5a60.zip
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 dba52417e..cd17afafe 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -121,8 +121,9 @@ enum { version2 = 0 };
121 121
122enum { MAX_DEPTH = 32 }; 122enum { MAX_DEPTH = 32 };
123 123
124enum { dev_fd = 3 };
125
124struct globals { 126struct globals {
125 int dev_fd;
126#if ENABLE_FEATURE_MINIX2 127#if ENABLE_FEATURE_MINIX2
127 smallint version2; 128 smallint version2;
128#endif 129#endif
@@ -158,7 +159,6 @@ struct globals {
158}; 159};
159 160
160#define G (*ptr_to_globals) 161#define G (*ptr_to_globals)
161#define dev_fd (G.dev_fd )
162#if ENABLE_FEATURE_MINIX2 162#if ENABLE_FEATURE_MINIX2
163#define version2 (G.version2 ) 163#define version2 (G.version2 )
164#endif 164#endif
@@ -1223,7 +1223,7 @@ int fsck_minix_main(int argc ATTRIBUTE_UNUSED, char **argv)
1223 if (!isatty(0) || !isatty(1)) 1223 if (!isatty(0) || !isatty(1))
1224 die("need terminal for interactive repairs"); 1224 die("need terminal for interactive repairs");
1225 } 1225 }
1226 dev_fd = xopen(device_name, OPT_repair ? O_RDWR : O_RDONLY); 1226 xmove_fd(xopen(device_name, OPT_repair ? O_RDWR : O_RDONLY), dev_fd);
1227 1227
1228 /*sync(); paranoia? */ 1228 /*sync(); paranoia? */
1229 read_superblock(); 1229 read_superblock();