aboutsummaryrefslogtreecommitdiff
path: root/util-linux/fsck_minix.c
diff options
context:
space:
mode:
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();